@wildo-ai/dev-companion 1.1.13 → 1.1.14

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 (256) hide show
  1. package/dist/esm/.tsbuildinfo +1 -1
  2. package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts +21 -0
  3. package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts.map +1 -1
  4. package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js +37 -4
  5. package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js.map +1 -1
  6. package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.d.ts.map +1 -1
  7. package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.js +9 -2
  8. package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.js.map +1 -1
  9. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.d.ts +66 -0
  10. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.d.ts.map +1 -1
  11. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js +183 -7
  12. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js.map +1 -1
  13. package/dist/esm/claude-cli/services/git-change-set.companion.service.d.ts +6 -2
  14. package/dist/esm/claude-cli/services/git-change-set.companion.service.d.ts.map +1 -1
  15. package/dist/esm/claude-cli/services/git-change-set.companion.service.js +16 -39
  16. package/dist/esm/claude-cli/services/git-change-set.companion.service.js.map +1 -1
  17. package/dist/esm/code-compliance-check/check-raw-feature-id-literals.companion.js +31 -2
  18. package/dist/esm/code-compliance-check/check-raw-feature-id-literals.companion.js.map +1 -1
  19. package/dist/esm/companion-api/companion-api.schemas.d.ts +2 -0
  20. package/dist/esm/companion-api/companion-api.schemas.d.ts.map +1 -1
  21. package/dist/esm/companion-api/companion-api.schemas.js +8 -0
  22. package/dist/esm/companion-api/companion-api.schemas.js.map +1 -1
  23. package/dist/esm/companion-api/controllers/companion.controller.d.ts +7 -0
  24. package/dist/esm/companion-api/controllers/companion.controller.d.ts.map +1 -1
  25. package/dist/esm/companion-api/controllers/companion.controller.js +26 -12
  26. package/dist/esm/companion-api/controllers/companion.controller.js.map +1 -1
  27. package/dist/esm/companion-api/controllers/long-held-request.companion.d.ts +17 -0
  28. package/dist/esm/companion-api/controllers/long-held-request.companion.d.ts.map +1 -0
  29. package/dist/esm/companion-api/controllers/long-held-request.companion.js +33 -0
  30. package/dist/esm/companion-api/controllers/long-held-request.companion.js.map +1 -0
  31. package/dist/esm/core/introspection/resources/creation-home-projection.companion.d.ts +9 -0
  32. package/dist/esm/core/introspection/resources/creation-home-projection.companion.d.ts.map +1 -1
  33. package/dist/esm/core/introspection/resources/creation-home-projection.companion.js +12 -0
  34. package/dist/esm/core/introspection/resources/creation-home-projection.companion.js.map +1 -1
  35. package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.d.ts.map +1 -1
  36. package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.js +7 -1
  37. package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.js.map +1 -1
  38. package/dist/esm/core/introspection/services/introspection-source-state.companion.service.d.ts +8 -20
  39. package/dist/esm/core/introspection/services/introspection-source-state.companion.service.d.ts.map +1 -1
  40. package/dist/esm/core/introspection/services/introspection-source-state.companion.service.js +37 -142
  41. package/dist/esm/core/introspection/services/introspection-source-state.companion.service.js.map +1 -1
  42. package/dist/esm/core/introspection/services/introspection-source-walk.worker.d.ts +64 -0
  43. package/dist/esm/core/introspection/services/introspection-source-walk.worker.d.ts.map +1 -0
  44. package/dist/esm/core/introspection/services/introspection-source-walk.worker.js +304 -0
  45. package/dist/esm/core/introspection/services/introspection-source-walk.worker.js.map +1 -0
  46. package/dist/esm/core/runtime/companion-language-model-route.d.ts +16 -1
  47. package/dist/esm/core/runtime/companion-language-model-route.d.ts.map +1 -1
  48. package/dist/esm/core/runtime/companion-language-model-route.js +23 -1
  49. package/dist/esm/core/runtime/companion-language-model-route.js.map +1 -1
  50. package/dist/esm/core/runtime/services/start-companion-application.service.d.ts.map +1 -1
  51. package/dist/esm/core/runtime/services/start-companion-application.service.js +3 -2
  52. package/dist/esm/core/runtime/services/start-companion-application.service.js.map +1 -1
  53. package/dist/esm/core/utils/git-read-broker.companion.d.ts +62 -0
  54. package/dist/esm/core/utils/git-read-broker.companion.d.ts.map +1 -0
  55. package/dist/esm/core/utils/git-read-broker.companion.js +282 -0
  56. package/dist/esm/core/utils/git-read-broker.companion.js.map +1 -0
  57. package/dist/esm/core/utils/local-write-recording.companion.d.ts +8 -1
  58. package/dist/esm/core/utils/local-write-recording.companion.d.ts.map +1 -1
  59. package/dist/esm/core/utils/local-write-recording.companion.js +7 -23
  60. package/dist/esm/core/utils/local-write-recording.companion.js.map +1 -1
  61. package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.en.d.ts +29 -0
  62. package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.en.d.ts.map +1 -0
  63. package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.en.js +29 -0
  64. package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.en.js.map +1 -0
  65. package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.fr.d.ts +29 -0
  66. package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.fr.d.ts.map +1 -0
  67. package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.fr.js +29 -0
  68. package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.fr.js.map +1 -0
  69. package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.en.d.ts +1 -0
  70. package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.en.d.ts.map +1 -1
  71. package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.en.js +2 -1
  72. package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.en.js.map +1 -1
  73. package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.fr.d.ts +1 -0
  74. package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.fr.d.ts.map +1 -1
  75. package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.fr.js +2 -1
  76. package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.fr.js.map +1 -1
  77. package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.en.d.ts +5 -2
  78. package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.en.d.ts.map +1 -1
  79. package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.en.js +5 -2
  80. package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.en.js.map +1 -1
  81. package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.fr.d.ts +5 -2
  82. package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.fr.d.ts.map +1 -1
  83. package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.fr.js +5 -2
  84. package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.fr.js.map +1 -1
  85. package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.en.d.ts +41 -0
  86. package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.en.d.ts.map +1 -0
  87. package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.en.js +41 -0
  88. package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.en.js.map +1 -0
  89. package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.fr.d.ts +41 -0
  90. package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.fr.d.ts.map +1 -0
  91. package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.fr.js +41 -0
  92. package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.fr.js.map +1 -0
  93. package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.en.d.ts +1 -0
  94. package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.en.d.ts.map +1 -1
  95. package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.en.js +2 -1
  96. package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.en.js.map +1 -1
  97. package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.fr.d.ts +1 -0
  98. package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.fr.d.ts.map +1 -1
  99. package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.fr.js +2 -1
  100. package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.fr.js.map +1 -1
  101. package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.en.d.ts +1 -0
  102. package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.en.d.ts.map +1 -1
  103. package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.en.js +2 -1
  104. package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.en.js.map +1 -1
  105. package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.fr.d.ts +1 -0
  106. package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.fr.d.ts.map +1 -1
  107. package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.fr.js +2 -1
  108. package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.fr.js.map +1 -1
  109. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.en.d.ts +1 -0
  110. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.en.d.ts.map +1 -1
  111. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.en.js +2 -1
  112. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.en.js.map +1 -1
  113. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.fr.d.ts +1 -0
  114. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.fr.d.ts.map +1 -1
  115. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.fr.js +2 -1
  116. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.fr.js.map +1 -1
  117. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.en.d.ts +2 -0
  118. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.en.d.ts.map +1 -1
  119. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.en.js +3 -1
  120. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.en.js.map +1 -1
  121. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.fr.d.ts +2 -0
  122. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.fr.d.ts.map +1 -1
  123. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.fr.js +3 -1
  124. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.fr.js.map +1 -1
  125. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_AUTH.en.d.ts +1 -1
  126. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_AUTH.en.js +1 -1
  127. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_AUTH.en.js.map +1 -1
  128. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_AUTH.fr.d.ts +1 -1
  129. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_AUTH.fr.js +1 -1
  130. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_AUTH.fr.js.map +1 -1
  131. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.en.d.ts +2 -0
  132. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.en.d.ts.map +1 -1
  133. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.en.js +3 -1
  134. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.en.js.map +1 -1
  135. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.fr.d.ts +3 -1
  136. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.fr.d.ts.map +1 -1
  137. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.fr.js +4 -2
  138. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.fr.js.map +1 -1
  139. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.en.d.ts +17 -0
  140. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.en.d.ts.map +1 -1
  141. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.en.js +18 -1
  142. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.en.js.map +1 -1
  143. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.fr.d.ts +17 -0
  144. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.fr.d.ts.map +1 -1
  145. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.fr.js +18 -1
  146. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.fr.js.map +1 -1
  147. package/dist/esm/i18n/composite_views/app.creation-conversation.fr.d.ts +206 -195
  148. package/dist/esm/i18n/composite_views/app.creation-conversation.fr.d.ts.map +1 -1
  149. package/dist/esm/i18n/composite_views/app.creation-conversation.fr.js +206 -195
  150. package/dist/esm/i18n/composite_views/app.creation-conversation.fr.js.map +1 -1
  151. package/dist/esm/i18n/composite_views/app.creation-dossier.fr.d.ts +10 -0
  152. package/dist/esm/i18n/composite_views/app.creation-dossier.fr.d.ts.map +1 -1
  153. package/dist/esm/i18n/composite_views/app.creation-dossier.fr.js +12 -2
  154. package/dist/esm/i18n/composite_views/app.creation-dossier.fr.js.map +1 -1
  155. package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.fr.d.ts +70 -0
  156. package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.fr.d.ts.map +1 -1
  157. package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.fr.js +70 -0
  158. package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.fr.js.map +1 -1
  159. package/dist/esm/i18n/resources/wildoApplicationActorTasks.fr.d.ts +12 -2
  160. package/dist/esm/i18n/resources/wildoApplicationActorTasks.fr.d.ts.map +1 -1
  161. package/dist/esm/i18n/resources/wildoApplicationActorTasks.fr.js +12 -2
  162. package/dist/esm/i18n/resources/wildoApplicationActorTasks.fr.js.map +1 -1
  163. package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.fr.d.ts +10 -0
  164. package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.fr.d.ts.map +1 -1
  165. package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.fr.js +10 -0
  166. package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.fr.js.map +1 -1
  167. package/dist/esm/i18n/resources/workbenchBuildDispatchPlan.fr.d.ts +25 -20
  168. package/dist/esm/i18n/resources/workbenchBuildDispatchPlan.fr.d.ts.map +1 -1
  169. package/dist/esm/i18n/resources/workbenchBuildDispatchPlan.fr.js +25 -20
  170. package/dist/esm/i18n/resources/workbenchBuildDispatchPlan.fr.js.map +1 -1
  171. package/dist/esm/i18n/resources/workbenchBuildPlanTasks.fr.d.ts +32 -32
  172. package/dist/esm/i18n/resources/workbenchBuildPlanTasks.fr.js +32 -32
  173. package/dist/esm/i18n/resources/workbenchBuildPlanTasks.fr.js.map +1 -1
  174. package/dist/esm/i18n/resources/workbenchBuildTaskRecords.fr.d.ts +65 -65
  175. package/dist/esm/i18n/resources/workbenchBuildTaskRecords.fr.js +65 -65
  176. package/dist/esm/i18n/resources/workbenchBuildTaskRecords.fr.js.map +1 -1
  177. package/dist/esm/i18n/resources/workbenchDossierEntries.fr.d.ts +20 -0
  178. package/dist/esm/i18n/resources/workbenchDossierEntries.fr.d.ts.map +1 -1
  179. package/dist/esm/i18n/resources/workbenchDossierEntries.fr.js +20 -0
  180. package/dist/esm/i18n/resources/workbenchDossierEntries.fr.js.map +1 -1
  181. package/dist/esm/i18n/resources/workbenchGovernanceQuestions.fr.d.ts +12 -0
  182. package/dist/esm/i18n/resources/workbenchGovernanceQuestions.fr.d.ts.map +1 -1
  183. package/dist/esm/i18n/resources/workbenchGovernanceQuestions.fr.js +13 -1
  184. package/dist/esm/i18n/resources/workbenchGovernanceQuestions.fr.js.map +1 -1
  185. package/dist/esm/i18n/system_enums/application-creation.fr.d.ts +170 -170
  186. package/dist/esm/i18n/system_enums/application-creation.fr.js +170 -170
  187. package/dist/esm/i18n/system_enums/application-creation.fr.js.map +1 -1
  188. package/dist/esm/i18n/system_enums/flows-actors.fr.d.ts +22 -22
  189. package/dist/esm/i18n/system_enums/flows-actors.fr.js +22 -22
  190. package/dist/esm/i18n/system_enums/flows-actors.fr.js.map +1 -1
  191. package/dist/esm/i18n/system_enums/run-records.fr.d.ts +21 -21
  192. package/dist/esm/i18n/system_enums/run-records.fr.js +21 -21
  193. package/dist/esm/i18n/system_enums/run-records.fr.js.map +1 -1
  194. package/dist/esm/i18n/system_enums/workbench-build.en.d.ts +1 -0
  195. package/dist/esm/i18n/system_enums/workbench-build.en.d.ts.map +1 -1
  196. package/dist/esm/i18n/system_enums/workbench-build.en.js +1 -0
  197. package/dist/esm/i18n/system_enums/workbench-build.en.js.map +1 -1
  198. package/dist/esm/i18n/system_enums/workbench-build.fr.d.ts +37 -33
  199. package/dist/esm/i18n/system_enums/workbench-build.fr.d.ts.map +1 -1
  200. package/dist/esm/i18n/system_enums/workbench-build.fr.js +37 -33
  201. package/dist/esm/i18n/system_enums/workbench-build.fr.js.map +1 -1
  202. package/dist/esm/i18n/system_enums/workbench-creation-home.en.d.ts +1 -0
  203. package/dist/esm/i18n/system_enums/workbench-creation-home.en.d.ts.map +1 -1
  204. package/dist/esm/i18n/system_enums/workbench-creation-home.en.js +1 -0
  205. package/dist/esm/i18n/system_enums/workbench-creation-home.en.js.map +1 -1
  206. package/dist/esm/i18n/system_enums/workbench-creation-home.fr.d.ts +18 -17
  207. package/dist/esm/i18n/system_enums/workbench-creation-home.fr.d.ts.map +1 -1
  208. package/dist/esm/i18n/system_enums/workbench-creation-home.fr.js +18 -17
  209. package/dist/esm/i18n/system_enums/workbench-creation-home.fr.js.map +1 -1
  210. package/dist/esm/i18n/system_enums/workbench-dossier.fr.d.ts +7 -5
  211. package/dist/esm/i18n/system_enums/workbench-dossier.fr.d.ts.map +1 -1
  212. package/dist/esm/i18n/system_enums/workbench-dossier.fr.js +8 -6
  213. package/dist/esm/i18n/system_enums/workbench-dossier.fr.js.map +1 -1
  214. package/dist/esm/i18n/system_enums/workbench-secrets.fr.d.ts +12 -12
  215. package/dist/esm/i18n/system_enums/workbench-secrets.fr.js +12 -12
  216. package/dist/esm/i18n/system_enums/workbench-secrets.fr.js.map +1 -1
  217. package/dist/esm/i18n/system_enums/workbench-specification-artifact.fr.d.ts +1 -0
  218. package/dist/esm/i18n/system_enums/workbench-specification-artifact.fr.d.ts.map +1 -1
  219. package/dist/esm/i18n/system_enums/workbench-specification-artifact.fr.js +2 -1
  220. package/dist/esm/i18n/system_enums/workbench-specification-artifact.fr.js.map +1 -1
  221. package/dist/esm/i18n-labelling/services/labelling-planner.companion.service.d.ts.map +1 -1
  222. package/dist/esm/i18n-labelling/services/labelling-planner.companion.service.js +3 -4
  223. package/dist/esm/i18n-labelling/services/labelling-planner.companion.service.js.map +1 -1
  224. package/dist/esm/i18n-labelling/utils/declared-refusal-codes.utils.d.ts +11 -0
  225. package/dist/esm/i18n-labelling/utils/declared-refusal-codes.utils.d.ts.map +1 -1
  226. package/dist/esm/i18n-labelling/utils/declared-refusal-codes.utils.js +21 -0
  227. package/dist/esm/i18n-labelling/utils/declared-refusal-codes.utils.js.map +1 -1
  228. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts +120 -16
  229. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts.map +1 -1
  230. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js +875 -191
  231. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js.map +1 -1
  232. package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.d.ts +102 -13
  233. package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.d.ts.map +1 -1
  234. package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.js +243 -57
  235. package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.js.map +1 -1
  236. package/dist/esm/meta-workflows/services/application-build-landing-projection.companion.d.ts +3 -3
  237. package/dist/esm/meta-workflows/services/application-build-landing-projection.companion.js +3 -3
  238. package/dist/esm/meta-workflows/services/application-build-landing-projection.companion.js.map +1 -1
  239. package/dist/esm/meta-workflows/services/application-build-task-closure.companion.d.ts +9 -0
  240. package/dist/esm/meta-workflows/services/application-build-task-closure.companion.d.ts.map +1 -1
  241. package/dist/esm/meta-workflows/services/application-build-task-closure.companion.js +19 -0
  242. package/dist/esm/meta-workflows/services/application-build-task-closure.companion.js.map +1 -1
  243. package/dist/esm/meta-workflows/services/creation-intervention-ledger.companion.service.d.ts.map +1 -1
  244. package/dist/esm/meta-workflows/services/creation-intervention-ledger.companion.service.js +4 -5
  245. package/dist/esm/meta-workflows/services/creation-intervention-ledger.companion.service.js.map +1 -1
  246. package/dist/esm/meta-workflows/services/foundation-executor.companion.service.d.ts.map +1 -1
  247. package/dist/esm/meta-workflows/services/foundation-executor.companion.service.js +6 -3
  248. package/dist/esm/meta-workflows/services/foundation-executor.companion.service.js.map +1 -1
  249. package/dist/esm/meta-workflows/services/playbook-run-write-register-window.companion.d.ts.map +1 -1
  250. package/dist/esm/meta-workflows/services/playbook-run-write-register-window.companion.js +3 -5
  251. package/dist/esm/meta-workflows/services/playbook-run-write-register-window.companion.js.map +1 -1
  252. package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts +1 -1
  253. package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts.map +1 -1
  254. package/dist/esm/meta-workflows/services/playbook-run.companion.service.js +38 -21
  255. package/dist/esm/meta-workflows/services/playbook-run.companion.service.js.map +1 -1
  256. package/package.json +18 -18
@@ -1 +1 @@
1
- {"version":3,"file":"foundation-executor.companion.service.js","sourceRoot":"","sources":["../../../../src/meta-workflows/services/foundation-executor.companion.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,cAAc,EAAE,iCAAiC,EAAwB,MAAM,+BAA+B,CAAC;AAC/L,OAAO,EAAE,2BAA2B,EAAE,MAAM,4CAA4C,CAAC;AAEzF,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EACL,4BAA4B,EAC5B,+BAA+B,EAC/B,2BAA2B,EAC3B,wBAAwB,EACxB,gCAAgC,EAChC,sBAAsB,EACtB,yBAAyB,EACzB,iCAAiC,GA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AAC,CAAC;IACtD,CAAC;IAED;;;;;OAKG;IACK,yBAAyB,CAAC,eAAuB;QACvD,MAAM,YAAY,GAAG,IAAI,CAAC,eAAe,EAAE,aAAa,EAAE,cAAc,CAAC,CAAC;QAC1E,IAAI,CAAC;YACH,MAAM,IAAI,GAAI,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC,CAAuB,CAAC,IAAI,CAAC;YACxF,IAAI,IAAI;gBAAE,OAAO,IAAI,CAAC;QACxB,CAAC;QAAC,MAAM,CAAC;YACP,0CAA0C;QAC5C,CAAC;QACD,MAAM,IAAI,wBAAwB,CAAC,+CAA+C,YAAY,qCAAqC,CAAC,CAAC;IACvI,CAAC;CACF,CAAA;AAllCY,kCAAkC;IAD9C,UAAU,EAAE;IAKR,WAAA,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAA;IACjC,WAAA,MAAM,CAAC,uBAAuB,CAAC,gBAAgB,CAAC,CAAA;;GALxC,kCAAkC,CAklC9C","sourcesContent":["import { execFile } from 'node:child_process';\nimport { existsSync, readFileSync } from 'node:fs';\nimport { basename, isAbsolute, join, relative, sep } from 'node:path';\nimport { promisify } from 'node:util';\n\nimport { BlueprintDeclarationFile, dataServingProviderRefs, loadInfraEnvConfig, loadSaasConfig, resolveProviderComplianceProfiles, type WildoSaasConfig } from '@wildo-ai/platform-config-lib';\nimport { withDependencyInstallRecord } from '@wildo-ai/platform-core-shared/dev-runtime';\n\nimport { inject, injectable } from 'inversify';\nimport {\n APPLICATION_LINE_DEFINITIONS,\n ApplicationLineDeclarationState,\n CORPORATE_IDENTITY_QUESTION,\n resolveLineAccessPosture,\n ApplicationOrganizationStructure,\n CompositionScenarioRef,\n DomainPlanOutputSetSchema,\n resolveApplicationLineDeclaration,\n type ApplicationCreatorInputs,\n} from '@wildo-ai/saas-specifications/application-creation';\nimport { SAAS_SERVICE_TYPES, describeCaughtError } from '@wildo-ai/saas-backend-lib';\nimport type { LoggerService } from '@wildo-ai/saas-backend-lib';\nimport { propagateAcceptedBrand, type CompanionBrandPropagation } from '../../brand/services/brand-propagation.companion.utils';\nimport { AppFrontendType, JurisdictionSlugListReadingKind, ProviderOriginKind, engineCapabilityResolutionModeTakesASelection, getEngineCapabilityResolutionMode, EngineCapability, parseJurisdictionSlugList } from '@wildo-ai/saas-models';\nimport { AvailableLanguage, languagePathSegment } from '@wildo-ai/saas-models/public-runtime';\nimport { engineProviderSpecifications } from '@wildo-ai/saas-specifications';\nimport type { SystemOfRecordVendorFacet } from '@wildo-ai/saas-models/external-data';\nimport { loadEffectiveSystemOfRecordFacets, rereadDeclaredSystemOfRecordInstances, type SystemOfRecordInstanceFacetRequest } from './system-of-record-facet-library.companion.utils';\n\nimport {\n APPLICATION_SPECIFICATION_SEMANTIC_SCHEMA_BINDINGS,\n addProviderToScope,\n applyCompositionScenarioPlan,\n createCompositionTemplateRenderer,\n deriveEngineCapabilityPlan,\n deriveFoundationCompositionPlan,\n readEngineCapabilityEnabled,\n SAAS_CONFIG_FILE_NAME,\n type FoundationCompositionPlan,\n creatorProviderAnswerFor,\n FoundationPrimaryScope,\n listCompositionScenarioDirectories,\n loadCompositionScenario,\n planCompositionScenario,\n ProviderPackageLinksService,\n readDeliveredOptInFrameworkPackages,\n resolveCompositionScenarioVariables,\n setEngineCapabilityEnabled,\n setProviderSelectionPrimary,\n type CompositionTemplateRenderer,\n type FoundationCapabilityBasis,\n type FoundationBackgroundExecutionOutcome,\n type FoundationCompositionScenarioOutcome,\n type FoundationHostFacts,\n type FoundationScenarioInvocation,\n layDownOperatorWithClients,\n applyLineAccessPosture,\n resolveCorporateIdentity,\n describeOwnerNamingDifference,\n renameOwnerToDomainPlanNames,\n type LineAccessPostureOutcome,\n composeOwnerOrganizationIdentityDeclaration,\n type OrganizationIdentityDeclarationComposition,\n backendDeclaresSystemsOfRecordLibrary,\n deriveSystemOfRecordNeeds,\n describeSystemOfRecordCredentialsOwed,\n type FoundationSystemOfRecordCredentials,\n type FoundationSystemOfRecordNeed,\n readSaasConfigOperatorWithClients,\n listSaasConfigOrganizationTypeRefs,\n setOrganizationTypeOwnsApplication,\n ORGANIZATION_IDENTITY_DECLARATION_FILE,\n propagateBrandAssets,\n DATA_RESIDENCY_TERRITORIES_QUESTION_REF,\n OPERATING_ENTITY_QUESTION_REF,\n OPERATING_JURISDICTIONS_QUESTION_REF,\n applyFoundationOperatorDeclarations,\n planFoundationOperatorDeclarations,\n type FoundationOperatorDeclarationsOutcome,\n FoundationDataResidencyState,\n applyFoundationDataResidency,\n planFoundationDataResidency,\n type FoundationDataResidencyOutcome,\n} from '@wildo-ai/application-creation-runtime';\n\nimport { COMPANION_SERVICE_TYPES } from '../../core/inject/models/service-types';\nimport type { CompanionContext } from '../../core/context/companion-context';\nimport { assertSpecificationsReadWhole } from '../../core/context/companion-package-loaders.companion';\nimport { loadSpecificationFamilyData } from '../../core/context/specification-family-data.companion';\n\n/**\n * The foundation playbook's EXECUTOR — the domain-plan → compose bridge, run instead of typed by\n * hand (J-1 stall F: a human read the approved domain plan, decided the `wildo compose` calls and\n * the ORGANIZATIONS flip, derived every scenario variable, and ran them one by one).\n *\n * `bottom_up.foundation` declares `outputs: []` and `executor: \"composite\"`: it lands no\n * specification family — its deliverable is the APPLICATION (config + composed module slices).\n * The generation route therefore cannot run it (J-1 stall E); this service is what does.\n *\n * The derivation is PURE (`deriveFoundationCompositionPlan`, tested against a literal domain\n * plan); this service supplies the host facts (app root, framework root, the shared-lib package\n * name) and executes: the capability mutation through the config-mutation service, and each\n * scenario through the same engine + THE SAME renderer `wildo compose` uses — identical scenario\n * bytes produce identical files regardless of which door applied them.\n *\n * Idempotent by the engine's own contract: a re-run plans byte-identical targets as SKIPS; a\n * target that exists with DIFFERENT bytes is a collision and the whole scenario REFUSES unapplied\n * (ownership transferred to the application; git is the undo). Nothing here commits — GUIDED\n * acceptance stays a human `git commit`.\n */\n\nexport interface FoundationScenarioExecutionRecord {\n readonly scenarioRef: string;\n /** The invocation's addressing variables (moduleId, resourceDir) — enough to identify the unit. */\n readonly subject: string;\n readonly writes: number;\n readonly skippedWrites: number;\n readonly editsApplied: number;\n readonly skippedEdits: number;\n /**\n * DRY-RUN only: this invocation could not be PLANNED because it edits files a preceding\n * invocation of the same run would create (an add-resource whose module is composed by this\n * run's own add-module). A real run applies sequentially and never hits this; a dry run reports\n * the dependency honestly instead of failing on it.\n */\n readonly deferredBehindModuleComposition?: true;\n /**\n * A scenario whose witness already exists — a package (the website, a minion), a module, a resource, or a\n * locale's label pack (#3453), composed by an earlier run or by the build since — so this run left it alone. Applying it would either skip every\n * byte-identical file (a no-op reported as writes) or refuse on the first authored one, and neither is\n * what a re-run means: the composition says the application HAS a website, and it does.\n */\n readonly alreadyComposed?: true;\n}\n\n/** The composition scenarios that create a surface serving the brand's icons and social image. */\nconst SURFACES_RECEIVING_THE_BRAND: ReadonlySet<string> = new Set<string>([\n CompositionScenarioRef.ADD_WEBSITE,\n CompositionScenarioRef.ADD_TECHNICAL_DOC,\n]);\n\n/** Whether this run composed — actually wrote, not found already composed — a surface that serves the brand. */\nexport function composedASurfaceReceivingTheBrand(scenarios: readonly Pick<FoundationScenarioExecutionRecord, 'scenarioRef' | 'writes' | 'alreadyComposed'>[]): boolean {\n return scenarios.some((record) => SURFACES_RECEIVING_THE_BRAND.has(record.scenarioRef) && record.alreadyComposed !== true && record.writes > 0);\n}\n\n/** One dependency install the foundation ran after changing a package manifest (#3204). */\nexport interface FoundationDependencyInstall {\n readonly succeeded: boolean;\n /** The manifests this run wrote that made the install owed, application-relative. */\n readonly manifests: readonly string[];\n readonly durationMs: number;\n /** The tail of what pnpm reported, when it failed. */\n readonly error?: string;\n}\n\n/**\n * Bound on the install: a cold store downloads a documentation toolchain (Docusaurus) in a few minutes, and a hung\n * registry must not hold the foundation run, and the build after it, for good.\n */\nconst FOUNDATION_DEPENDENCY_INSTALL_TIMEOUT_MS = 15 * 60 * 1000;\n\nexport interface FoundationExecutionResult {\n readonly playbookRef: 'bottom_up.foundation';\n readonly primaryScope: FoundationPrimaryScope;\n readonly engineCapabilityChanges: ReadonlyArray<{\n readonly capability: string;\n /** WHICH declaration decided it — so the record says why, not merely what (#1272). */\n readonly basis: FoundationCapabilityBasis;\n readonly changed: boolean;\n readonly summary: string;\n /**\n * Set when this run also DECLARED a provider so the capability could be enabled at all.\n *\n * Carried loudly rather than folded into the summary, because a credential-free provider is a\n * DEVELOPMENT SUBSTITUTE by construction — `email-preview` renders mail to a local surface and\n * its own module says to \"wire it as the `EMAIL_TRANSACTIONAL` primary in local environments…\n * with no live API key and no mail actually leaving the machine\". The application is configured\n * and working; replacing it is a deployment decision somebody still owes, and a record that did\n * not say so would let it ship unnoticed.\n *\n * spec-cite: N/A — INTERNAL. The quotation is this repository's own\n * `engine/external-connectors-private/src/providers/email-preview/email-preview.backend.module.ts`\n * module JSDoc, not an external standard. An earlier revision quoted \"never select it as primary\n * in an environment that serves real users\", which appears in no specification anywhere — a\n * paraphrase wearing quotation marks, the exact shape\n * `.claude/rules/external-specification-citations.md` exists to retire.\n */\n readonly servedByDeclaredProvider?: {\n readonly providerRef: string;\n readonly developmentSubstitute: true;\n readonly replaceBeforeRealUsers: string;\n };\n /**\n * The provider the CREATOR chose in the foundation interview (#1488), declared, selected and enabled\n * by this run. `credentialsOwed` names the env vars the provider requires and this process cannot\n * supply: the application boots (the floor reads declaration + selection), and the provider's own\n * calls fail until an operator sets them. Mark, never gate.\n */\n readonly servedByCreatorSelectedProvider?: {\n readonly providerRef: string;\n readonly credentialsOwed: ReadonlyArray<{ readonly envVarName: string; readonly description: string }>;\n readonly remedy: string;\n };\n }>;\n /**\n * Capabilities the application NEEDS and this run deliberately did not enable, because the engine\n * refuses to boot with them on and no provider resolving, and the journey cannot declare one.\n *\n * Reported rather than silently dropped: a derivation whose result nobody can see is a derivation\n * nobody acts on, and the remedy — declare a provider for it — is a sentence an operator can act\n * on today. `application-creation-directive.md`: mark, never gate.\n */\n readonly engineCapabilitiesOwedAProvider: ReadonlyArray<{\n readonly capability: string;\n readonly basis: FoundationCapabilityBasis;\n readonly remedy: string;\n }>;\n readonly scenarios: readonly FoundationScenarioExecutionRecord[];\n /** The accepted brand mark copied into a surface this run composed (a website, a portal). Absent when none was composed. */\n readonly brandPropagation?: CompanionBrandPropagation;\n /**\n * How this application's organizations are arranged, and what this run declared for it (#1605, #2305).\n * `owed` is set when a single-owner line's configuration does not name one organization type unambiguously, when\n * the operator-with-clients structure cannot be laid down beside the configuration's types without the creator's\n * choice (#2968: several types and no owner, computed type keys, both relationship names taken), or when it was laid\n * down and ORGANIZATIONS is still off: marked, never gated, since all are authoring work.\n */\n readonly applicationOwnership?: {\n readonly required: boolean;\n readonly basis: string;\n /** How the line arranges the organizations (#2305). */\n readonly structure?: ApplicationOrganizationStructure;\n readonly organizationTypeRef?: string;\n readonly changed?: boolean;\n readonly summary?: string;\n readonly owed?: string;\n /** Set when this run declared ownership: what an application that booted BEFORE it still owes (the promotion door). */\n readonly afterFirstBoot?: string;\n };\n /**\n * Capabilities the application's line says it never has, which its configuration enables anyway (#1605): an\n * internal tool with billing on. Reported, never switched off and never refused (`application-creation-directive.md`):\n * turning a capability off is the person's edit, and the remedy names it. Empty when the configuration agrees.\n */\n readonly engineCapabilitiesContradictingLine: ReadonlyArray<{ readonly capability: EngineCapability; readonly remedy: string }>;\n /**\n * The access posture the line gives the application (#3037), when it gives one: the registration mode of the owner's\n * user types (an internal tool's people are invited or provisioned, never self-registered) and, once the company has\n * answered `corporate-identity`, the enterprise sign-in methods, SCIM provisioning and the features their doors need.\n * `owed` lists what could not be written, each with its remedy; absent when the line decides nothing (a B2B SaaS, a\n * service firm, no line yet) or the organizations are not arranged as a single owner.\n */\n readonly accessPosture?: LineAccessPostureOutcome;\n /**\n * The owner organization's identity declaration (#3043): `backend-api/src/organization-identity.ts`, derived from the\n * `corporate-identity` answer and passed to startup as `organizationIdentity`, which the backend applies at every boot\n * (#3038). The single sign-on posture follows from the answer; the company's units and its directory's department →\n * unit mapping are named by nothing the creation lane holds, so they are `owed`, never invented. `owed` alone, with\n * nothing composed, when the answer is missing. Absent when no line is declared, on a line that does not ask for the\n * corporate identity, and when the access posture found no owner organization type (it is not laid down for an\n * operator serving clients, and its own `owed` names a missing owner).\n */\n readonly organizationIdentity?: OrganizationIdentityDeclarationComposition | { readonly owed: readonly string[] };\n /**\n * The systems of record the domain plan puts records in (#3039), each with the resources it holds and the credentials\n * its instance will owe, named as the backend reads them. `owed` says why credentials could not be named (an unknown\n * kind, an unread facet library, a credential kind the company chooses). The facet library (`@wildo-ai/systems-of-record`,\n * opt-in) is declared and linked by the CLI once the build declares the instance; `libraryDeclared` says whether the\n * backend declares it already. Empty when every resource's records are the application's own.\n */\n readonly systemsOfRecord: ReadonlyArray<FoundationSystemOfRecordNeed & FoundationSystemOfRecordCredentials & { readonly libraryDeclared: boolean }>;\n /**\n * What the capability composition decided, scenario by scenario (#1491): every scenario applied and every\n * scenario declined, with the declaration each came from. Empty when no composition has landed yet.\n */\n readonly compositionScenarios: readonly FoundationCompositionScenarioOutcome[];\n /**\n * What the run read about workers and minions (#1544): composed, declared none, or had no readable\n * integration plan to read. The last two used to be one silence.\n */\n readonly backgroundExecution: FoundationBackgroundExecutionOutcome;\n /** The host facts the optional-package scenarios were composed with, and where the public domain came from. */\n readonly hostFacts?: FoundationHostFacts & { readonly publicDomainSource: string };\n /**\n * Every file this run WROTE, application-root-relative and POSIX (#3237): each configuration edit a step reported as\n * a change, each composed scenario's writes and edits, the organization identity declaration and its wiring, and the\n * brand files propagated to a surface composed now. The run's write record is computed from these, never from\n * everything that changed in the tree while it ran: a coding agent writing in the same seconds is not the\n * foundation, and its work must not be accepted under the foundation's name. Empty on a dry run.\n */\n readonly writtenPaths: readonly string[];\n /**\n * What this run still COMPOSES without writing it again (application-relative files and directories): every target a\n * scenario its plan asks for and found already composed would write or edit (planned, never applied, so a module's\n * four trees and its registry, barrel and companion-exports edits are all here), and each configuration file an edit\n * found already in place. A completed run's landing adopts what a failed run left there (#3237 review F4, H1). Empty\n * on a dry run.\n */\n readonly stillComposedPaths: readonly string[];\n /**\n * The dependency install this run owed (#3204): run when it wrote a package manifest or the workspace file, absent when\n * it wrote neither. A failure is reported here and the run still lands, because the remedy is an install, not a\n * different composition.\n */\n readonly dependencyInstall?: FoundationDependencyInstall;\n /**\n * The application's data residency (#2294), from the `data-residency-territories` answer: what was written\n * (`operatorComplianceIdentity.dataResidency` and each provider region the residency leaves no choice about) and what\n * is left open. The residency is written only once every data-serving provider is placed inside it; until then\n * `advisory` and `unplacedProviders` say why, and `wildo context launch-blockers` lists each provider. Marked, never\n * gated: an unanswered question writes nothing and travels here as an advisory.\n */\n readonly dataResidency?: FoundationDataResidencyOutcome;\n /**\n * The operator's identity parts and operating jurisdictions (#2294 follow-up), from the `operating-entity` and\n * `operating-jurisdictions` answers: each part or jurisdiction the configuration lacked, written; an authored value that\n * differs, kept and named in `advisories`; an unanswered or unreadable answer, nothing written and named likewise.\n * Absent only when the configuration could not be read, which `advisory` then says.\n */\n readonly operatorDeclarations?: FoundationOperatorDeclarationsOutcome | { readonly advisory: string };\n}\n\n/**\n * An engine provider this run may declare on the application's behalf, without asking anyone.\n *\n * ## The criterion is an EMPTY SECRETS CONTRACT, and that is the whole of it\n *\n * A capability in `ENGINE_CAPABILITIES_REQUIRING_A_PROVIDER_WHEN_ENABLED` cannot be enabled without\n * a provider — the backend refuses to boot. Choosing one is usually a commercial decision nobody in\n * this process is entitled to take: which payment processor, which mail vendor, on whose account.\n *\n * But a provider that declares NO SECRETS needs no account, so choosing it commits the operator to\n * nothing they can be billed or bound by. Measured across the whole engine catalogue (2026-09-17),\n * exactly two providers qualify, and only one of them serves a boot-floor capability:\n *\n * | provider | secrets | serves |\n * |---|---|---|\n * | `email-preview` | none | EMAIL_TRANSACTIONAL |\n * | `opencode` | none | AI_CODING_AGENT — not in the boot floor, and not derived by the journey |\n *\n * `stripe`, `twilio`, `resend` and every AI vendor carry a secrets contract, so BILLING and SMS stay\n * OWED. That asymmetry is the point rather than a limitation: the journey configures what costs\n * nothing to configure and leaves the commercial choices to the human who owns them.\n *\n * ## It is DERIVED from the specifications, never listed here\n *\n * A hand-kept list of another catalogue's contents is the shape that rots — the same argument the\n * build task's workspace scope makes. A provider that drops its secrets contract tomorrow becomes\n * eligible the day it does, and one that grows a secrets contract stops being, with no edit here.\n */\nexport interface SelfConfiguringProviderChoice {\n readonly providerRef: string;\n readonly providerCapabilities: readonly string[];\n readonly protocols: readonly string[];\n}\n\nexport function resolveCredentialFreeEngineProvider(capability: EngineCapability): SelfConfiguringProviderChoice | undefined {\n const candidates = Object.values(engineProviderSpecifications).filter((specification) => (\n specification.engineCapabilities.includes(capability)\n && specification.secretsContract.length === 0\n && specification.origin.kind === ProviderOriginKind.ENGINE\n // A backend-scope declaration is what the boot floor reads; a frontend-only module cannot serve it.\n && specification.facets.includes('backend')\n ));\n /*\n * Exactly one, or none. Two credential-free providers for one capability would be a CHOICE, and a\n * choice is the thing this function exists not to make on somebody's behalf — so it declines and\n * the capability stays owed, which is the outcome a human can still resolve.\n */\n if (candidates.length !== 1) return undefined;\n const chosen = candidates[0]!;\n return {\n providerRef: chosen.ref,\n providerCapabilities: chosen.providerCapabilities,\n protocols: chosen.protocols,\n };\n}\n\n/** Refusals a creator can act on (missing scope answer, unwired domain plan, collisions). */\n/**\n * The engine providers a creator may be OFFERED for a capability: ENGINE-origin, backend-scoped, serving it\n * (#1488). This is the options vocabulary of the foundation interview's provider questions, and the test\n * beside this file pins the AUTHORED options to it, so a vendor added to the catalogue is offered by being\n * added rather than by somebody remembering the question.\n */\nexport function listEngineProviderRefsServing(capability: EngineCapability): readonly string[] {\n return Object.values(engineProviderSpecifications)\n .filter((specification) => (\n specification.engineCapabilities.includes(capability)\n && specification.origin.kind === ProviderOriginKind.ENGINE\n && specification.facets.includes('backend')\n ))\n .map((specification) => specification.ref)\n .sort();\n}\n\nexport type CreatorSelectedProviderResolution =\n | {\n readonly kind: 'selected';\n readonly providerRef: string;\n readonly providerCapabilities: readonly string[];\n readonly protocols: readonly string[];\n /** The provider's REQUIRED secrets, by env var — what the operator still owes before it answers. */\n readonly credentialsOwed: ReadonlyArray<{ readonly envVarName: string; readonly description: string }>;\n }\n | {\n /** The creator named something the catalogue does not offer for this capability. Reported, never guessed around. */\n readonly kind: 'refused';\n readonly reason: string;\n };\n\n/**\n * The creator's provider choice for a capability, read off the foundation interview (#1488).\n *\n * `undefined` when the question was not answered or answered `none` (`PROVIDER_CHOICE_NONE`) — the honest\n * value: the interview requires an answer to every question, so \"decide later\" is an option, and it leaves\n * the capability OWED exactly as before (#1272). An answer outside the offered set is `refused` with the set\n * named. **That arm is a floor for DIRECT callers, not a run path**: through `runPlaybook` the interview\n * validator (`validateElicitationAnswer`) refuses an out-of-options answer before the executor is called, and\n * the compiled options are pinned to this very derivation, so a run never reaches it. Secrets are not checked\n * here: the boot floor reads declaration and selection, so the chosen provider can be declared and the\n * capability enabled while the credentials stay OWED.\n */\nexport function resolveCreatorSelectedEngineProvider(\n capability: EngineCapability,\n answers: ReadonlyArray<{ readonly questionRef: string; readonly answer: string }>,\n): CreatorSelectedProviderResolution | undefined {\n const answer = creatorProviderAnswerFor(capability, answers);\n if (answer === undefined) return undefined;\n const offered = listEngineProviderRefsServing(capability);\n const chosen = Object.values(engineProviderSpecifications).find((specification) => specification.ref === answer);\n if (!chosen || !offered.includes(answer)) {\n return {\n kind: 'refused',\n reason: `The interview answer \"${answer}\" names no engine provider serving ${capability}. Offered: ${offered.join(', ') || '(none)'}.`,\n };\n }\n return {\n kind: 'selected',\n providerRef: chosen.ref,\n providerCapabilities: chosen.providerCapabilities,\n protocols: chosen.protocols,\n credentialsOwed: chosen.secretsContract\n .filter((secret) => secret.required)\n .map((secret) => ({ envVarName: secret.envVarName, description: secret.description })),\n };\n}\n\n/** What {@link FoundationExecutorCompanionService.deriveSatisfiableEngineCapabilityPlan} answers (#2497). */\nexport interface SatisfiableEngineCapabilityPlan {\n readonly plan: Pick<FoundationCompositionPlan, 'engineCapabilityChanges' | 'engineCapabilitiesOwedAProvider'>;\n /** Every capability in the plan, in order: what the `engine-capabilities` step must leave enabled to land. */\n readonly capabilities: readonly EngineCapability[];\n}\n\n/** What the build lane's `engine-capabilities` step did (#2497). */\nexport interface EngineCapabilityAlignmentResult extends Pick<FoundationExecutionResult, 'engineCapabilityChanges' | 'engineCapabilitiesOwedAProvider'> {\n /** `false` when no domain plan with a tenancy has landed, so nothing could be derived. */\n readonly derived: boolean;\n readonly capabilities: readonly EngineCapability[];\n}\n\nexport class FoundationExecutionError extends Error {}\n\n/**\n * The path whose presence says a scenario has ALREADY been composed — its WITNESS: a directory, or for a locale\n * its label pack. Total over the vocabulary; `null` means the scenario has no path of its own (a custom operation,\n * a provider block) and is never skipped on that ground.\n *\n * Modules and resources have witnesses too (#1544), and that is what makes the foundation re-runnable\n * once the build has started. With `null` for both, every re-run re-planned `add-module` and\n * `add-resource` from scratch and collided with the files the build's own tasks had written since —\n * seven of them on the first end-to-end run — and a diverged target refuses the whole scenario, so the\n * run never reached the minion it was re-run for. A module whose directory exists was composed; the\n * build owns its bytes from then on, and re-composing it can only overwrite or refuse.\n *\n * A FUNCTION of the invocation's own variables, not a constant, because three of them compose one\n * package PER SURFACE (#1496's review): a worker lands in `workers/<workerDir>` and a minion in\n * `minions/<minionDir>`, so a fixed string cannot say whether THIS minion is already there.\n *\n * Getting that wrong was not cosmetic. `add-minion` appends the deny-all `resourceAccess` whitelist\n * verbatim, and the append REFUSES a key already present with a different value — so once a minion's\n * build task widened the whitelist, as its own design requires, the next foundation run died on that\n * minion and never reached the second one. Measured against the real scenario and apply pipeline.\n */\nconst COMPOSED_WITNESS_DIRECTORY: Readonly<Record<CompositionScenarioRef, ((variables: Readonly<Record<string, string>>) => string | null) | null>> = {\n [CompositionScenarioRef.ADD_MODULE]: (variables) => `shared-lib/src/modules/${variables['moduleId']}`,\n [CompositionScenarioRef.ADD_RESOURCE]: (variables) => `shared-lib/src/modules/${variables['moduleId']}/resources/${variables['resourceDir']}`,\n [CompositionScenarioRef.ADD_CUSTOM_OPERATION]: null,\n [CompositionScenarioRef.ADD_WEBSITE]: () => 'website',\n [CompositionScenarioRef.ADD_WEBSITE_SECTION]: null,\n [CompositionScenarioRef.ADD_MARKETING_PAGE]: null,\n [CompositionScenarioRef.ADD_TECHNICAL_DOC]: () => 'technical-doc',\n [CompositionScenarioRef.ADD_MINION]: (variables) => `minions/${variables['minionDir']}`,\n [CompositionScenarioRef.ADD_WORKER_NODE]: (variables) => `workers/${variables['workerDir']}`,\n [CompositionScenarioRef.ADD_WORKER_RUST]: (variables) => `workers/${variables['workerDir']}`,\n [CompositionScenarioRef.ADD_PROVIDER]: null,\n [CompositionScenarioRef.ADD_FILE_PICKER_PROVIDER]: null,\n [CompositionScenarioRef.ADD_ENVIRONMENT]: null,\n /*\n * A locale is registered once its label pack exists (#3453). `add-locale` writes the pack, the starter hero and the\n * landing route, and registers the locale in `wildo.website.config.ts`, all or nothing, so the pack stands for the\n * whole scenario. From then on the application owns the pack: translating it is the scenario's own post-note, and a\n * re-applied scenario would find it changed and refuse the whole foundation run. reference-creation-ci's foundation\n * failed every re-run on `website/src/i18n/de.json` and stayed a REFRESH the loop chose again each round.\n *\n * The pack is named by the locale's path segment, derived from the member exactly as the scenario derives\n * `localePath`. A member that names no language has no pack to find; the planner refuses it before this is asked.\n */\n [CompositionScenarioRef.ADD_LOCALE]: (variables) => {\n const member = variables['localeMember'];\n const language = member !== undefined && Object.hasOwn(AvailableLanguage, member) ? (AvailableLanguage as Record<string, string>)[member] : undefined;\n return language === undefined ? null : `website/src/i18n/${languagePathSegment(language)}.json`;\n },\n // No directory of its own: the 3D layout is a dependency and a registration in the existing frontend.\n [CompositionScenarioRef.ADD_3D_LAYOUT]: null,\n};\n\n/**\n * The witness directory of an invocation that is ALREADY composed in this application, or null when it\n * must be applied — the one decision that makes a foundation re-run safe (#1544).\n */\nexport function alreadyComposedWitness(\n invocation: { readonly scenarioRef: CompositionScenarioRef; readonly variables: Readonly<Record<string, string>> },\n applicationRoot: string,\n): string | null {\n const resolveDirectory = COMPOSED_WITNESS_DIRECTORY[invocation.scenarioRef];\n const witnessDirectory = resolveDirectory === null ? null : resolveDirectory(invocation.variables);\n return witnessDirectory !== null && existsSync(join(applicationRoot, witnessDirectory)) ? witnessDirectory : null;\n}\n\n@injectable()\nexport class FoundationExecutorCompanionService {\n private readonly logDebug: (message: string, context?: Record<string, unknown>) => void;\n\n public constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(COMPANION_SERVICE_TYPES.CompanionContext) private readonly companionContext: CompanionContext,\n ) {\n this.logDebug = this.logger.debugByType('FoundationExecutorCompanionService');\n }\n\n public async execute(input: {\n /** The landed domain-plan VALUE (the run service resolves it from artifact state). */\n readonly domainPlan: unknown;\n /**\n * The creator's tenancy answer — the FALLBACK, for a domain plan authored before the plan\n * carried `tenancy` itself. A plan that states it wins, because that is the committed decision.\n */\n readonly elicitationAnswers: ReadonlyArray<{ readonly questionRef: string; readonly answer: string }>;\n /** Compute and report everything, write nothing. */\n readonly dryRun?: boolean;\n /**\n * Told each file as this run writes it (#3237), so a run that fails part-way still names what it wrote: its landing\n * records those, under `landingFailed`, rather than leaving them for another lane's commit. A completed run also\n * reports them all in `writtenPaths`.\n */\n readonly onWrite?: (applicationRelativePath: string) => void;\n /**\n * Told each file a step MAY write, before the step runs (#3237 review M3): a configuration editor, the ownership,\n * access-posture and identity declarations, the brand propagation. The landing marks it in flight; only a file the\n * step then reports writing (`onWrite`) enters the record.\n */\n readonly onMayWrite?: (applicationRelativePath: string) => void;\n }): Promise<FoundationExecutionResult> {\n // It composes from the landed families, and a family read short changes what it composes (#3258). Run again once the module evaluates.\n if (input.dryRun !== true) await assertSpecificationsReadWhole(this.companionContext, 'The foundation');\n const primaryScope = this.resolvePrimaryScope(input.domainPlan, input.elicitationAnswers);\n const applicationRoot = this.companionContext.saasRoot;\n // What this run writes, as each step reports it (#3237). A dry run reports nothing written.\n const written = new Set<string>();\n const toApplicationPath = (filePath: string): string => (isAbsolute(filePath) ? relative(applicationRoot, filePath) : filePath).split(sep).join('/');\n const noteWrite = (filePath: string): void => {\n if (input.dryRun === true) return;\n const applicationRelativePath = toApplicationPath(filePath);\n written.add(applicationRelativePath);\n input.onWrite?.(applicationRelativePath);\n };\n const noteMayWrite = (filePath: string): void => {\n if (input.dryRun !== true) input.onMayWrite?.(toApplicationPath(filePath));\n };\n // What this run composes without rewriting (#3237 review H1): see `stillComposedPaths`.\n const stillComposed = new Set<string>();\n const noteComposed = (filePath: string): void => {\n if (input.dryRun !== true) stillComposed.add(toApplicationPath(filePath));\n };\n const sharedLibPackage = this.readSharedLibPackageName(applicationRoot);\n\n const businessModel = await this.readLandedFamilyValue('business-model');\n const capabilityComposition = await this.readLandedFamilyValue('capability-composition');\n /* What runs beside the backend (#1495) — one scenario per worker and per minion it declares. */\n const integrationPlan = await this.readLandedFamilyValue('integration-plan');\n /* The application's line (#1605) decides whether one organization owns it. */\n const creatorInputs = await this.readLandedFamilyValue('creator-inputs') as ApplicationCreatorInputs | undefined;\n const lineDeclaration = resolveApplicationLineDeclaration(creatorInputs);\n /*\n * Host facts are needed by an optional PACKAGE scenario, and a worker or a minion is one: its\n * package name derives from the application slug. So they are resolved whenever EITHER family\n * has landed, not only for the composition.\n */\n const hostFacts = capabilityComposition === undefined && integrationPlan === undefined ? undefined : await this.resolveHostFacts(applicationRoot);\n const plan = deriveFoundationCompositionPlan({\n domainPlan: input.domainPlan,\n primaryScope,\n sharedLibPackage,\n ...(businessModel === undefined ? {} : { businessModel }),\n ...(capabilityComposition === undefined ? {} : { capabilityComposition }),\n /*\n * The backend-api name is read only when a MINION will need it. An integration plan declaring\n * workers and no minion refused the whole foundation run over an unreadable manifest that\n * nothing was going to use.\n */\n ...(integrationPlan === undefined ? {} : {\n integrationPlan,\n ...(this.declaresAMinion(integrationPlan) ? { backendApiPackage: this.readBackendApiPackageName(applicationRoot) } : {}),\n }),\n ...(hostFacts === undefined ? {} : { hostFacts }),\n elicitationAnswers: input.elicitationAnswers,\n ...(lineDeclaration.state === ApplicationLineDeclarationState.DECLARED ? { applicationLine: lineDeclaration.line } : {}),\n /* A secondary line needing the firm's method makes it a firm serving clients, whatever its line (#2305). */\n ...(creatorInputs === undefined ? {} : { creatorInputs }),\n });\n this.logDebug('Foundation composition plan derived', {\n primaryScope,\n businessModelRead: businessModel !== undefined,\n capabilityCompositionRead: capabilityComposition !== undefined,\n integrationPlanRead: integrationPlan !== undefined,\n capabilityChanges: plan.engineCapabilityChanges.length,\n capabilitiesOwedAProvider: plan.engineCapabilitiesOwedAProvider.length,\n scenarioInvocations: plan.scenarioInvocations.length,\n });\n\n // Capability first: the composed resources' primary-scope posture assumes it.\n // The configuration editors write the application configuration: named before they run (#3237 review M3).\n noteMayWrite(SAAS_CONFIG_FILE_NAME);\n const { engineCapabilityChanges, engineCapabilitiesOwedAProvider } = this.applyEngineCapabilityPlan({\n plan,\n elicitationAnswers: input.elicitationAnswers,\n ...(input.dryRun === true ? { dryRun: true } : {}),\n noteWrite,\n noteComposed,\n });\n\n const frameworkRoot = this.companionContext.resolvedHomes.framework.repositoryRoot ?? null;\n const scenarioDirectoriesByRef = listCompositionScenarioDirectories({ applicationRoot, frameworkRoot });\n const renderer: CompositionTemplateRenderer = createCompositionTemplateRenderer();\n\n const modulesComposedByThisRun = new Set(\n plan.scenarioInvocations\n .filter((invocation) => invocation.scenarioRef === CompositionScenarioRef.ADD_MODULE)\n .map((invocation) => String(invocation.variables['moduleId'])),\n );\n const scenarios: FoundationScenarioExecutionRecord[] = [];\n for (const invocation of plan.scenarioInvocations) {\n // DRY-RUN sequencing honesty: an add-resource edits its module's registry files, which the\n // same run's add-module WRITES. A real run applies sequentially so the files exist by then;\n // a dry run plans against the unmodified tree, where planning the edit would (correctly)\n // refuse on a missing target. Report the dependency instead of failing the whole preview.\n if (\n input.dryRun === true\n && invocation.scenarioRef === CompositionScenarioRef.ADD_RESOURCE\n && modulesComposedByThisRun.has(String(invocation.variables['moduleId']))\n && !existsSync(join(applicationRoot, 'shared-lib', 'src', 'modules', String(invocation.variables['moduleId'])))\n ) {\n scenarios.push({\n scenarioRef: invocation.scenarioRef,\n subject: `${invocation.variables['moduleId']}/${invocation.variables['resourceDir']}`,\n writes: 0, skippedWrites: 0, editsApplied: 0, skippedEdits: 0,\n deferredBehindModuleComposition: true,\n });\n continue;\n }\n const witnessDirectory = alreadyComposedWitness(invocation, applicationRoot);\n if (witnessDirectory !== null) {\n if (input.dryRun !== true) {\n noteComposed(witnessDirectory);\n // Everything the scenario WOULD write or edit, planned as a dry run plans it (#3237 review H1): a module is four\n // trees and five registry, barrel and companion-exports edits, and its witness names only one of the trees.\n for (const target of this.planInvocationTargets({ invocation, applicationRoot, scenarioDirectoriesByRef, renderer })) noteComposed(target);\n }\n scenarios.push({ scenarioRef: invocation.scenarioRef, subject: witnessDirectory, writes: 0, skippedWrites: 0, editsApplied: 0, skippedEdits: 0, alreadyComposed: true });\n continue;\n }\n scenarios.push(this.applyInvocation({ invocation, applicationRoot, scenarioDirectoriesByRef, renderer, dryRun: input.dryRun === true, noteWrite }));\n }\n /*\n * A surface composed NOW receives the mark accepted EARLIER. The logo step propagates when it runs,\n * but once landed it is never dispatched again, so a website or portal composed after it — a\n * conception re-run that newly decides one — would serve no favicon and no Open Graph image. This is\n * the moment that surface appears, so this is where it is supplied. Nothing accepted: nothing written.\n */\n const propagatesBrand = composedASurfaceReceivingTheBrand(scenarios) && input.dryRun !== true;\n if (propagatesBrand) {\n // Named before the propagation writes them (#3237 review M3): what a dry run of the same propagation would write.\n const preview = await propagateBrandAssets({ appRoot: applicationRoot, dryRun: true }).catch(() => undefined);\n for (const destination of preview?.destinations ?? []) for (const wouldWrite of destination.result?.wrote ?? []) noteMayWrite(wouldWrite);\n }\n const brandPropagation = propagatesBrand ? await propagateAcceptedBrand(applicationRoot, this.logger) : undefined;\n /*\n * The ownership, access-posture and identity steps edit the application's declaration files and author the identity\n * declaration; which of them is known only inside each step, so the whole set is named before they run (#3237\n * review M3). Only what a step reports changing enters the record; one it found in place is still composed.\n */\n for (const declarationFile of Object.values(BlueprintDeclarationFile)) noteMayWrite(declarationFile);\n noteMayWrite(ORGANIZATION_IDENTITY_DECLARATION_FILE);\n const applicationOwnership = this.declareApplicationOwnership(\n plan.applicationOwnership,\n applicationRoot,\n input.dryRun === true,\n engineCapabilityChanges.some((change) => change.capability === EngineCapability.ORGANIZATIONS),\n );\n const accessPosture = this.applyAccessPosture({ lineDeclaration, applicationOwnership, applicationRoot, elicitationAnswers: input.elicitationAnswers, domainPlan: input.domainPlan, dryRun: input.dryRun === true });\n const organizationIdentity = this.declareOwnerOrganizationIdentity({ lineDeclaration, accessPosture, applicationRoot, domainPlan: input.domainPlan, dryRun: input.dryRun === true });\n // Both ownership layouts edit the application configuration, and say only whether they changed it.\n if (applicationOwnership.changed === true) noteWrite(SAAS_CONFIG_FILE_NAME);\n else if (applicationOwnership.changed === false) noteComposed(SAAS_CONFIG_FILE_NAME);\n for (const write of accessPosture?.writes ?? []) (write.changed ? noteWrite : noteComposed)(write.file);\n if (organizationIdentity !== undefined && 'declarationFile' in organizationIdentity) {\n (organizationIdentity.declarationFile.changed ? noteWrite : noteComposed)(organizationIdentity.declarationFile.path);\n (organizationIdentity.wiring.changed ? noteWrite : noteComposed)(organizationIdentity.wiring.path);\n }\n for (const destination of brandPropagation?.propagation?.destinations ?? []) for (const wrote of destination.result?.wrote ?? []) noteWrite(wrote);\n /*\n * The data residency LAST among the configuration edits (#2294): it places the providers every earlier step declared\n * (a capability's provider, a composed minion's scope), and a provider declared after it would be one it never saw.\n */\n // The operator's identity and jurisdictions first: the residency writes into the same identity object after them.\n const operatorDeclarations = await this.declareOperatorDeclarations({ applicationRoot, elicitationAnswers: input.elicitationAnswers, dryRun: input.dryRun === true });\n if (operatorDeclarations.changed) noteWrite(SAAS_CONFIG_FILE_NAME);\n else if (operatorDeclarations.composed) noteComposed(SAAS_CONFIG_FILE_NAME);\n const dataResidency = await this.declareDataResidency({ applicationRoot, elicitationAnswers: input.elicitationAnswers, dryRun: input.dryRun === true });\n if (dataResidency.changed) noteWrite(SAAS_CONFIG_FILE_NAME);\n else if (dataResidency.writes.length > 0) noteComposed(SAAS_CONFIG_FILE_NAME);\n const dependencyInstall = input.dryRun === true ? undefined : await this.installDependenciesIfManifestsChanged(applicationRoot, written, noteWrite);\n return {\n playbookRef: 'bottom_up.foundation',\n primaryScope,\n engineCapabilityChanges,\n engineCapabilitiesOwedAProvider,\n scenarios,\n applicationOwnership,\n engineCapabilitiesContradictingLine: this.findEngineCapabilitiesContradictingLine(applicationRoot, lineDeclaration),\n ...(accessPosture === undefined ? {} : { accessPosture }),\n ...(organizationIdentity === undefined ? {} : { organizationIdentity }),\n systemsOfRecord: await this.declareSystemsOfRecord(input.domainPlan, applicationRoot),\n compositionScenarios: plan.compositionScenarios,\n backgroundExecution: plan.backgroundExecution,\n ...(hostFacts === undefined ? {} : { hostFacts }),\n ...(brandPropagation === undefined ? {} : { brandPropagation }),\n writtenPaths: [...written].sort(),\n stillComposedPaths: [...stillComposed].sort(),\n ...(dependencyInstall === undefined ? {} : { dependencyInstall }),\n dataResidency: dataResidency.outcome,\n operatorDeclarations: operatorDeclarations.outcome,\n };\n }\n\n /**\n * Write the operator's identity parts and operating jurisdictions the interview answered (#2294 follow-up), through\n * `planFoundationOperatorDeclarations` over the configuration as it stands now: additive only, an authored value kept,\n * an unanswered question an advisory. Never thrown: a configuration it cannot read (or an authored shape the writer\n * refuses to edit) is reported with nothing written, and the foundation lands.\n */\n private async declareOperatorDeclarations(input: {\n readonly applicationRoot: string;\n readonly elicitationAnswers: ReadonlyArray<{ readonly questionRef: string; readonly answer: string }>;\n readonly dryRun: boolean;\n }): Promise<{ readonly outcome: FoundationOperatorDeclarationsOutcome | { readonly advisory: string }; readonly changed: boolean; readonly composed: boolean }> {\n const answerTo = (questionRef: string): string | undefined => input.elicitationAnswers.find((candidate) => candidate.questionRef === questionRef)?.answer;\n try {\n const saasConfig = await this.loadApplicationConfigFresh(input.applicationRoot);\n const plan = planFoundationOperatorDeclarations({\n entityAnswer: answerTo(OPERATING_ENTITY_QUESTION_REF),\n jurisdictionsAnswer: answerTo(OPERATING_JURISDICTIONS_QUESTION_REF),\n declaredIdentity: saasConfig.operatorComplianceIdentity,\n declaredJurisdictions: saasConfig.operatingJurisdictions,\n });\n const { changed, ...outcome } = applyFoundationOperatorDeclarations({ applicationRoot: input.applicationRoot, plan, dryRun: input.dryRun });\n this.logDebug('Foundation operator declarations', { identity: plan.identity.state, jurisdictions: plan.operatingJurisdictions.state, changed });\n return { outcome, changed: changed && !input.dryRun, composed: outcome.writes.length > 0 };\n } catch (error) {\n const advisory = `The operator's identity and operating jurisdictions could not be written, and nothing was written for them: ${describeCaughtError(error)}`;\n this.logDebug(advisory);\n return { outcome: { advisory }, changed: false, composed: false };\n }\n }\n\n /**\n * Write the data residency the interview answered, after placing the providers that serve the application's data\n * (#2294). The decision is `planFoundationDataResidency`, over the configuration as it stands NOW (re-loaded, since\n * this run edited it) and the providers' compliance profiles through the application's own discovery, the population\n * and profiles `wildo config sync` refuses on. Never thrown: a configuration or a discovery it cannot read is reported\n * NOT_EVALUATED with nothing written, so the foundation lands and the residency stays visibly open.\n */\n private async declareDataResidency(input: {\n readonly applicationRoot: string;\n readonly elicitationAnswers: ReadonlyArray<{ readonly questionRef: string; readonly answer: string }>;\n readonly dryRun: boolean;\n }): Promise<{ readonly outcome: FoundationDataResidencyOutcome; readonly changed: boolean; readonly writes: FoundationDataResidencyOutcome['writes'] }> {\n const answer = input.elicitationAnswers.find((candidate) => candidate.questionRef === DATA_RESIDENCY_TERRITORIES_QUESTION_REF)?.answer;\n try {\n const saasConfig = await this.loadApplicationConfigFresh(input.applicationRoot);\n const providerRefs = dataServingProviderRefs(saasConfig.providers.scopes);\n // Profiles are read only when places were answered: nothing else consults them, and discovery loads every provider package.\n const placesAnswered = answer !== undefined && parseJurisdictionSlugList(answer).kind === JurisdictionSlugListReadingKind.SLUGS;\n const discovery = placesAnswered ? await this.resolveProviderComplianceProfiles(input.applicationRoot, saasConfig) : undefined;\n const plan = planFoundationDataResidency({\n answer,\n declared: saasConfig.operatorComplianceIdentity?.dataResidency,\n choices: saasConfig.providerComplianceChoices,\n profilesByProviderRef: discovery?.profilesByProviderRef ?? {},\n providerRefs,\n });\n const applied = applyFoundationDataResidency({ applicationRoot: input.applicationRoot, plan, dryRun: input.dryRun });\n const { filePath: _filePath, changed, ...outcome } = applied;\n const unreadable = discovery?.unreadableOwners ?? [];\n const withUnreadable: FoundationDataResidencyOutcome = unreadable.length === 0 || plan.state !== FoundationDataResidencyState.PROVIDERS_UNPLACED\n ? outcome\n : { ...outcome, advisory: `${outcome.advisory ?? ''} Provider discovery could not read ${unreadable.length} owner(s), so a provider reported without a profile may have one there.`.trim() };\n this.logDebug('Foundation data residency', { state: plan.state, derived: plan.derivedChoices.length, unplaced: plan.unplacedProviders.length, changed });\n return { outcome: withUnreadable, changed: changed && !input.dryRun, writes: outcome.writes };\n } catch (error) {\n const outcome: FoundationDataResidencyOutcome = {\n state: FoundationDataResidencyState.NOT_EVALUATED,\n derivedChoices: [],\n unplacedProviders: [],\n writes: [],\n advisory: `The data residency could not be evaluated, and nothing was written for it: ${describeCaughtError(error)}`,\n };\n this.logDebug('The foundation could not evaluate the data residency; nothing was written for it', { error: describeCaughtError(error) });\n return { outcome, changed: false, writes: [] };\n }\n }\n\n /** `wildo.saas.config.ts` as it stands now, past this run's own edits (never the boot-time config). */\n private async loadApplicationConfigFresh(applicationRoot: string): Promise<WildoSaasConfig> {\n const config = await loadSaasConfig(join(applicationRoot, SAAS_CONFIG_FILE_NAME), { freshModuleCache: true });\n if (config === null) throw new Error(`${join(applicationRoot, SAAS_CONFIG_FILE_NAME)} could not be loaded`);\n return config;\n }\n\n /** The providers' compliance profiles through the application's own discovery, as `wildo config sync` reads them. */\n private async resolveProviderComplianceProfiles(applicationRoot: string, saasConfig: WildoSaasConfig): ReturnType<typeof resolveProviderComplianceProfiles> {\n return resolveProviderComplianceProfiles({ saasRoot: applicationRoot, saasConfig });\n }\n\n /**\n * Install the application's dependencies when this run changed what they are (#3204).\n *\n * A composed scenario that adds a workspace package (`add-minion`, `add-technical-doc`, `add-website`, …) or edits a\n * manifest (overrides (pnpm-workspace.yaml), a dependency) leaves the lockfile describing the application BEFORE it. Each scenario's\n * post-note tells a person to run `pnpm install`; an unattended creation has no person, so the run that changed the\n * manifests runs it. Measured on reference run 42468505853: the foundation added a technical-documentation site and\n * three minions, nothing installed them, and every later restart of the development stack retried a frozen reinjection\n * that refused the stale lockfile (`ERR_PNPM_LOCKFILE_CONFIG_MISMATCH`), while the new packages had no dependencies to\n * compile against.\n *\n * `--no-frozen-lockfile` is deliberate: the lockfile must follow the manifests this run changed, and pnpm freezes it by\n * default when `CI` is set. The lockfile is recorded as one of this run's writes, so it lands in the same commit as the\n * manifests it describes. Never thrown: the composition stands, and a failed install is reported for a person to repeat.\n */\n private async installDependenciesIfManifestsChanged(\n applicationRoot: string,\n written: ReadonlySet<string>,\n noteWrite: (filePath: string) => void,\n ): Promise<FoundationDependencyInstall | undefined> {\n const manifests = [...written].filter((path) => basename(path) === 'package.json' || path === 'pnpm-workspace.yaml').sort();\n if (manifests.length === 0) return undefined;\n const startedAt = Date.now();\n /*\n * The links those manifests need first, as `wildo compose` writes them: a composed minion declares\n * `@wildo-ai/wildo-dev-runtime`, an opt-in framework package linked only where declared, and without its override\n * pnpm asks the public registry for it (404, reference run 42486534966). It never REMOVES an override; it may REWRITE\n * one whose value differs from the link it owes (a hand-set version of a linked package), as `wildo compose` does, and\n * the root manifest then enters this run's commit. In app-creator mode (no checkout) the records come from the\n * engine-peer closure delivered with the templates (#3492), and an opt-in package pins to the application's framework\n * release.\n */\n try {\n const frameworkPath = this.companionContext.resolvedHomes?.framework?.repositoryRoot ?? null;\n // Without a checkout, the opt-in records delivered with the templates (#3492); with one, the checkout's own.\n const deliveredOptIn = frameworkPath === null ? readDeliveredOptInFrameworkPackages(applicationRoot) : undefined;\n const links = ProviderPackageLinksService.reconcileAndReport({\n applicationRoot,\n frameworkPath,\n log: { info: (message) => this.logDebug(message), warn: (message) => this.logger.warn(message) },\n write: true,\n ...(deliveredOptIn === undefined ? {} : { optInFrameworkPackages: deliveredOptIn }),\n });\n if (links.added.length > 0) noteWrite('package.json');\n } catch (error) {\n const install = { succeeded: false, manifests, durationMs: Date.now() - startedAt, error: `The framework package links could not be written: ${describeCaughtError(error)}` } as const;\n this.logger.warn('The foundation could not link the framework packages its composition declared; run `wildo compose` or link them, then `pnpm install`', install);\n return install;\n }\n const lockfilePath = join(applicationRoot, 'pnpm-lock.yaml');\n const lockfileBefore = existsSync(lockfilePath) ? readFileSync(lockfilePath, 'utf8') : undefined;\n try {\n /*\n * The install is a STACK EVENT (#3552): it re-creates `node_modules` while `wildo local dev` runs against it. The\n * record tells every supervisor to hold its runtime and spend no crash budget until it ends, then to relaunch (after\n * repairing the injected snapshots), and every compile watcher that read the tree before it ended to compile again.\n * Without it, reference run 42666728304 left three packages FAILED on a missing `typescript/lib`, the backend paused\n * and the companion's own creation reads answering 500.\n */\n await withDependencyInstallRecord(\n applicationRoot,\n {\n initiator: 'foundation',\n timeoutMs: FOUNDATION_DEPENDENCY_INSTALL_TIMEOUT_MS,\n reportFailure: (message, error) => this.logger.warn(message, { error: describeCaughtError(error) }),\n },\n () => promisify(execFile)('pnpm', ['install', '--prefer-offline', '--no-frozen-lockfile'], {\n cwd: applicationRoot,\n timeout: FOUNDATION_DEPENDENCY_INSTALL_TIMEOUT_MS,\n maxBuffer: 16 * 1024 * 1024,\n }),\n );\n const lockfileAfter = existsSync(lockfilePath) ? readFileSync(lockfilePath, 'utf8') : undefined;\n if (lockfileAfter !== lockfileBefore) noteWrite('pnpm-lock.yaml');\n const install = { succeeded: true, manifests, durationMs: Date.now() - startedAt } as const;\n this.logger.info('The foundation installed the dependencies its composition changed', install);\n return install;\n } catch (error) {\n // pnpm reports a failure on STDOUT (`ERR_PNPM_…`), so both streams are kept, stdout's tail first.\n const caught = error as { readonly stdout?: string; readonly stderr?: string; readonly message?: string };\n const detail = [caught.stdout?.trim(), caught.stderr?.trim()].filter(Boolean).join('\\n') || caught.message || String(error);\n const tail = detail.slice(-2000);\n const install = { succeeded: false, manifests, durationMs: Date.now() - startedAt, error: tail } as const;\n this.logger.warn('The foundation could not install the dependencies its composition changed; run `pnpm install` at the application root', install);\n return install;\n }\n }\n\n /**\n * Turn on what a capability plan says this application needs (#1272, #1488), and report what stays owed.\n *\n * Shared by the foundation run and by the build lane's `engine-capabilities` step (#2497), so the two cannot\n * disagree about how a need becomes configuration: a provider-free capability is enabled; a capability the\n * engine refuses to boot without a provider is served by the creator's chosen provider, else by a\n * credential-free engine provider, else reported owed.\n */\n private applyEngineCapabilityPlan(input: {\n readonly plan: Pick<FoundationCompositionPlan, 'engineCapabilityChanges' | 'engineCapabilitiesOwedAProvider'>;\n readonly elicitationAnswers: ReadonlyArray<{ readonly questionRef: string; readonly answer: string }>;\n readonly dryRun?: boolean;\n /** Told each file a configuration edit changed (#3237): the foundation's write record is computed from them. */\n readonly noteWrite?: (filePath: string) => void;\n /** Told each file a configuration edit found already in place: still composed by this run (#3237 review H1). */\n readonly noteComposed?: (filePath: string) => void;\n }): Pick<FoundationExecutionResult, 'engineCapabilityChanges' | 'engineCapabilitiesOwedAProvider'> {\n const applicationRoot = this.companionContext.saasRoot;\n const noted = <T extends { readonly changed: boolean; readonly filePath: string }>(result: T): T => {\n if (result.changed) input.noteWrite?.(result.filePath);\n else input.noteComposed?.(result.filePath);\n return result;\n };\n const engineCapabilityChanges: FoundationExecutionResult['engineCapabilityChanges'][number][] = input.plan.engineCapabilityChanges.map((change) => {\n const result = noted(setEngineCapabilityEnabled({\n applicationRoot,\n capability: change.capability,\n enabled: true,\n ...(input.dryRun === true ? { dryRun: true } : {}),\n }));\n return { capability: change.capability, basis: change.basis, changed: result.changed, summary: result.summary };\n });\n /*\n * An owed capability is SERVED here when a credential-free engine provider exists for it (#1272)\n * — declared, selected and enabled in one pass — and stays owed otherwise. Three mutations,\n * because two of them are not optional: the boot floor needs a provider in the scope, and a\n * SELECT_ONE capability needs `selection[<capability>].primary` beside it. The capability is\n * enabled LAST, so a failure part-way leaves the application not-yet-configured rather than\n * enabled-and-unbootable.\n */\n const engineCapabilitiesOwedAProvider: FoundationExecutionResult['engineCapabilitiesOwedAProvider'][number][] = [];\n for (const owed of input.plan.engineCapabilitiesOwedAProvider) {\n /*\n * The creator's own choice comes FIRST (#1488): an answered provider question is a decision, and a\n * credential-free substitute must never override one. A `refused` resolution cannot occur through a\n * run (the interview validator refuses first) and is handled anyway — reported on the owed entry with\n * the offered set — so a direct caller of the executor gets the same honest answer as a run.\n */\n const selected = resolveCreatorSelectedEngineProvider(owed.capability, input.elicitationAnswers);\n if (selected?.kind === 'refused') {\n engineCapabilitiesOwedAProvider.push({ capability: owed.capability, basis: owed.basis, remedy: `${selected.reason} Answer the question again with one of them.` });\n continue;\n }\n if (selected?.kind === 'selected') {\n const writeOptions = input.dryRun === true ? { dryRun: true as const } : {};\n noted(addProviderToScope({\n applicationRoot,\n scope: { kind: 'backend' },\n providerRef: selected.providerRef,\n engineCapabilities: [owed.capability],\n providerCapabilities: selected.providerCapabilities,\n protocols: selected.protocols,\n ...writeOptions,\n }));\n if (engineCapabilityResolutionModeTakesASelection(getEngineCapabilityResolutionMode(owed.capability))) {\n noted(setProviderSelectionPrimary({\n applicationRoot,\n scope: { kind: 'backend' },\n capability: owed.capability,\n primaryProviderRef: selected.providerRef,\n ...writeOptions,\n }));\n }\n const enabled = noted(setEngineCapabilityEnabled({ applicationRoot, capability: owed.capability, enabled: true, ...writeOptions }));\n engineCapabilityChanges.push({\n capability: owed.capability,\n basis: owed.basis,\n changed: enabled.changed,\n summary: enabled.summary,\n servedByCreatorSelectedProvider: {\n providerRef: selected.providerRef,\n credentialsOwed: selected.credentialsOwed,\n remedy: selected.credentialsOwed.length === 0\n ? `\\`${selected.providerRef}\\` needs no credentials; ${owed.capability} is enabled and serving.`\n : `\\`${selected.providerRef}\\` is declared, selected and ${owed.capability} is enabled — the application boots, and `\n + `${owed.capability} answers once these are set in the environment: ${selected.credentialsOwed.map((secret) => secret.envVarName).join(', ')}.`,\n },\n });\n continue;\n }\n const provider = resolveCredentialFreeEngineProvider(owed.capability);\n if (!provider) {\n engineCapabilitiesOwedAProvider.push({\n capability: owed.capability,\n basis: owed.basis,\n remedy: `This application's own declarations imply ${owed.capability} (${owed.basis}), and it is NOT enabled: `\n + 'the engine refuses to boot with it on and no provider resolving, and every provider that serves it '\n + 'needs an account this process cannot open. Declare one that serves '\n + `${owed.capability} in \\`wildo.saas.config.ts\\` under \\`providers.scopes\\`, then enable the capability beside it.`,\n });\n continue;\n }\n const writeOptions = input.dryRun === true ? { dryRun: true as const } : {};\n noted(addProviderToScope({\n applicationRoot,\n scope: { kind: 'backend' },\n providerRef: provider.providerRef,\n engineCapabilities: [owed.capability],\n providerCapabilities: provider.providerCapabilities,\n protocols: provider.protocols,\n ...writeOptions,\n }));\n // Only a SELECT_ONE capability carries a `selection` entry: FAN_OUT takes every declared provider and\n // BOUND_PER_PURPOSE is bound per key purpose (#2891), so writing one would put the provider into a mechanism\n // nothing consults.\n if (engineCapabilityResolutionModeTakesASelection(getEngineCapabilityResolutionMode(owed.capability))) {\n noted(setProviderSelectionPrimary({\n applicationRoot,\n scope: { kind: 'backend' },\n capability: owed.capability,\n primaryProviderRef: provider.providerRef,\n ...writeOptions,\n }));\n }\n const enabled = noted(setEngineCapabilityEnabled({\n applicationRoot,\n capability: owed.capability,\n enabled: true,\n ...writeOptions,\n }));\n engineCapabilityChanges.push({\n capability: owed.capability,\n basis: owed.basis,\n changed: enabled.changed,\n summary: enabled.summary,\n servedByDeclaredProvider: {\n providerRef: provider.providerRef,\n developmentSubstitute: true,\n replaceBeforeRealUsers: `\\`${provider.providerRef}\\` needs no account, which is why this run could declare it — `\n + 'and it is a DEVELOPMENT substitute. Replace it with a provider that really serves '\n + `${owed.capability} before this application faces real users.`,\n },\n });\n }\n return { engineCapabilityChanges, engineCapabilitiesOwedAProvider };\n }\n\n /**\n * The engine capabilities the application's LANDED decisions imply and this companion can turn on without a\n * person (#2497), whether or not they are on already: every provider-free need, and every need a\n * credential-free engine provider can serve. A need that only a commercial provider can serve (BILLING, SMS)\n * is left out, because no step of ours can satisfy it and a step that can never land would hold the build.\n *\n * Read from the landed domain plan's `tenancy`, the business model and the integration plan, the same\n * inputs the foundation reads. `undefined` when no domain plan with a tenancy has landed: there is nothing\n * to derive from, which is a different answer from \"nothing is needed\". Throws when one of those inputs could not be\n * read: an unknown input must not shrink the plan.\n */\n public async deriveSatisfiableEngineCapabilityPlan(): Promise<SatisfiableEngineCapabilityPlan | undefined> {\n const landedDomainPlan = await this.readLandedFamilyValue('domain-plan');\n const domainPlan = DomainPlanOutputSetSchema.safeParse(landedDomainPlan);\n // A plan that landed and does not parse is not one that never landed: what it decides is unknown (#3258).\n if (!domainPlan.success && landedDomainPlan !== undefined) throw new Error(`The landed domain plan does not satisfy its schema: ${domainPlan.error.issues[0]?.message}`);\n if (!domainPlan.success || domainPlan.data.tenancy === undefined) return undefined;\n const businessModel = await this.readLandedFamilyValue('business-model');\n const integrationPlan = await this.readLandedFamilyValue('integration-plan');\n // The line excludes some capabilities whatever implies them (#1605), on this lane exactly as in the foundation.\n const lineDeclaration = resolveApplicationLineDeclaration(await this.readLandedFamilyValue('creator-inputs') as ApplicationCreatorInputs | undefined);\n const derived = deriveEngineCapabilityPlan({\n primaryScope: domainPlan.data.tenancy,\n businessModel,\n ...(integrationPlan === undefined ? {} : { integrationPlan }),\n // The build lane has no foundation interview, so no creator provider choice: only credential-free service.\n elicitationAnswers: [],\n ...(lineDeclaration.state === ApplicationLineDeclarationState.DECLARED ? { applicationLine: lineDeclaration.line } : {}),\n });\n const plan = {\n engineCapabilityChanges: derived.engineCapabilityChanges,\n engineCapabilitiesOwedAProvider: derived.engineCapabilitiesOwedAProvider\n .filter((owed) => resolveCredentialFreeEngineProvider(owed.capability) !== undefined),\n };\n return { plan, capabilities: [...plan.engineCapabilityChanges, ...plan.engineCapabilitiesOwedAProvider].map((need) => need.capability) };\n }\n\n /**\n * The build lane's `engine-capabilities` step (#2497): enable every satisfiable capability the decisions imply\n * that the application's configuration does not already enable.\n *\n * A capability already on is left exactly as it is, provider included: re-declaring `email-preview` over a\n * provider the creator chose afterwards would undo a decision. So this only ever ADDS what is missing.\n *\n * \"Missing\" includes an explicit `enabled: false`, and that is deliberate: the scaffold itself writes\n * `ORGANIZATIONS: { enabled: false }`, so `false` cannot be read as a creator's decision. The consequence is\n * that a creator who turns off a capability the decisions imply sees it turned back on at the next build;\n * the remedy is the decision itself (the domain plan's tenancy, the integration plan's channels). The same\n * holds for a capability declared with a provider but disabled: enabling it here also declares and, for a\n * SELECT_ONE capability, selects the credential-free provider beside the one already declared.\n */\n public async alignEngineCapabilitiesWithDecisions(input: { readonly dryRun?: boolean } = {}): Promise<EngineCapabilityAlignmentResult> {\n const satisfiable = await this.deriveSatisfiableEngineCapabilityPlan();\n if (satisfiable === undefined) return { derived: false, capabilities: [], engineCapabilityChanges: [], engineCapabilitiesOwedAProvider: [] };\n const filePath = join(this.companionContext.saasRoot, SAAS_CONFIG_FILE_NAME);\n const content = readFileSync(filePath, 'utf8');\n const missing = (need: { readonly capability: EngineCapability }) => readEngineCapabilityEnabled({ filePath, content, capability: need.capability }) !== true;\n const applied = this.applyEngineCapabilityPlan({\n plan: {\n engineCapabilityChanges: satisfiable.plan.engineCapabilityChanges.filter(missing),\n engineCapabilitiesOwedAProvider: satisfiable.plan.engineCapabilitiesOwedAProvider.filter(missing),\n },\n elicitationAnswers: [],\n ...(input.dryRun === true ? { dryRun: true } : {}),\n });\n return { derived: true, capabilities: satisfiable.capabilities, ...applied };\n }\n\n /**\n * The host facts an optional-package scenario needs and no family declares (#1491): the slug and display\n * name from the SaaS config, the port block from the declared services, and the public domain from the\n * application's own infrastructure environments — a REMOTE one first (production, then staging), because\n * that is the apex the website and the portal derive their canonical origins from, and the local one\n * otherwise. `localhost` when no environment declares one, which is the value the framework's own local\n * example uses; the source is recorded on the result so a reader can see which it was.\n */\n private async resolveHostFacts(applicationRoot: string): Promise<FoundationHostFacts & { readonly publicDomainSource: string }> {\n const services = Object.values(this.companionContext.servicesByKey);\n const backendPort = services.find((service) => service.frontendType === undefined)?.defaultPort;\n const appPort = services.find((service) => service.frontendType === AppFrontendType.SAAS_APP)?.defaultPort;\n if (backendPort === undefined || appPort === undefined) {\n throw new FoundationExecutionError(\n 'The optional-package scenarios derive their ports from the backend and app services\\' `defaultPort`, and `wildo.saas.config.ts` declares no such port for '\n + (backendPort === undefined ? 'the backend service' : 'the app service') + '.',\n );\n }\n let publicDomain = 'localhost';\n let publicDomainSource = 'default (no environment declares a public domain)';\n for (const envName of ['production', 'staging', 'local']) {\n try {\n const loaded = await loadInfraEnvConfig(applicationRoot, envName, { freshModuleCache: true });\n const declared = (loaded?.config as { publicDomain?: unknown } | undefined)?.publicDomain;\n if (typeof declared === 'string' && declared.trim().length > 0) {\n publicDomain = declared.trim();\n publicDomainSource = `infrastructure/${envName}`;\n break;\n }\n } catch (error) {\n this.logDebug(`Could not read infrastructure/${envName}; not a source for the public domain`, { error: describeCaughtError(error) });\n }\n }\n return {\n slug: this.companionContext.saasConfig.slug,\n displayName: this.companionContext.saasConfig.displayName,\n publicDomain,\n backendPort,\n appPort,\n publicDomainSource,\n };\n }\n\n /**\n * Lay down the access posture of the application's line (#3037), after its owner is declared, through the one\n * function the line's blueprint also uses (`applyLineAccessPosture`). Only for a single owner: there the owner's user\n * types are every user type. An application arranged as an operator serving clients shares its user type with clients\n * who sign up on their own, so closing registration there would close theirs; nothing is written, and nothing is owed.\n *\n * The corporate identity is the company's answer to `corporate-identity`. An answer that is not one of its values\n * cannot reach here (the interview validator refuses it) and is treated as unanswered.\n */\n private applyAccessPosture(input: {\n readonly lineDeclaration: ReturnType<typeof resolveApplicationLineDeclaration>;\n readonly applicationOwnership: NonNullable<FoundationExecutionResult['applicationOwnership']>;\n readonly applicationRoot: string;\n readonly elicitationAnswers: ReadonlyArray<{ readonly questionRef: string; readonly answer: string }>;\n /** The landed domain plan, which may state the corporate identity through its owner type's joining. */\n readonly domainPlan?: unknown;\n readonly dryRun: boolean;\n }): LineAccessPostureOutcome | undefined {\n if (input.lineDeclaration.state !== ApplicationLineDeclarationState.DECLARED) return undefined;\n if (input.applicationOwnership.structure !== ApplicationOrganizationStructure.SINGLE_OWNER) return undefined;\n const answer = input.elicitationAnswers.find((candidate) => candidate.questionRef === CORPORATE_IDENTITY_QUESTION.questionRef)?.answer;\n // The company's answer, else what the domain plan states (its owner type joining from the directory, #3035).\n const { corporateIdentity, disagreement } = resolveCorporateIdentity({ answer, domainPlan: input.domainPlan });\n try {\n /*\n * The plan may name the owner and its people otherwise (`group` / `employee` against the scaffold's `workspace` /\n * `member`). The foundation renames them first, through declared renames (`renamedFrom`), which move the owner\n * organization and the first administrator the platform already created at the backend's next start (#3044); the\n * posture is then laid down under the new names. A rename it cannot make writes nothing and is owed.\n */\n const rename = input.domainPlan === undefined\n ? undefined\n : renameOwnerToDomainPlanNames({\n applicationRoot: input.applicationRoot,\n domainPlan: input.domainPlan,\n ...(input.applicationOwnership.organizationTypeRef === undefined ? {} : { ownerOrganizationTypeRef: input.applicationOwnership.organizationTypeRef }),\n ...(input.dryRun ? { dryRun: true } : {}),\n });\n const ownerOrganizationTypeRef = rename?.ownerOrganizationTypeRef ?? input.applicationOwnership.organizationTypeRef;\n const posture = applyLineAccessPosture({\n applicationRoot: input.applicationRoot,\n line: input.lineDeclaration.line,\n ...(corporateIdentity === undefined ? {} : { corporateIdentity }),\n // A dry run declares the owner without writing it, so it is handed over rather than re-read.\n ...(ownerOrganizationTypeRef === undefined ? {} : { ownerOrganizationTypeRef }),\n ...(input.dryRun ? { dryRun: true } : {}),\n });\n const outcome: LineAccessPostureOutcome = rename === undefined || (rename.organizationTypeRename === undefined && rename.userTypeRename === undefined && rename.owed.length === 0)\n ? posture\n : {\n ...posture,\n ownerRename: {\n ...(rename.organizationTypeRename === undefined ? {} : { organizationTypeRename: rename.organizationTypeRename }),\n ...(rename.userTypeRename === undefined ? {} : { userTypeRename: rename.userTypeRename }),\n },\n writes: [...rename.writes, ...posture.writes],\n owed: [...rename.owed, ...(rename.afterFirstBoot === undefined ? [] : [rename.afterFirstBoot]), ...posture.owed],\n };\n // What the rename could not give the plan's names stays reported, with the declared rename as its remedy.\n const naming = outcome.ownerOrganizationTypeRef === undefined || outcome.ownerUserTypes === undefined\n ? undefined\n : describeOwnerNamingDifference({ domainPlan: input.domainPlan, ownerOrganizationTypeRef: outcome.ownerOrganizationTypeRef, ownerUserTypes: outcome.ownerUserTypes });\n const reported = [disagreement, naming].filter((entry): entry is string => entry !== undefined);\n return reported.length === 0 ? outcome : { ...outcome, owed: [...outcome.owed, ...reported] };\n } catch (error) {\n return {\n registrationMode: resolveLineAccessPosture(input.lineDeclaration.line).ownerUserRegistrationMode,\n writes: [],\n owed: [`The ${input.lineDeclaration.line} line's sign-up and sign-in posture could not be laid down: ${describeCaughtError(error)}`],\n };\n }\n }\n\n /**\n * Author the owner organization's identity declaration and wire it into startup (#3043), through the creation\n * runtime's `composeOwnerOrganizationIdentityDeclaration`. Only where the line asks for the corporate identity (the\n * internal tool: one company's people are the users) and the access posture found the organization type that owns the\n * application, since startup refuses an `APPLICATION_OWNER` declaration with no such type. The answer is the one the\n * access posture applied (the company's answer, else what the domain plan states); with none, nothing is written and\n * the answer is owed. A failure is reported owed, never thrown: authoring work, so it is marked, never gated.\n */\n private declareOwnerOrganizationIdentity(input: {\n readonly lineDeclaration: ReturnType<typeof resolveApplicationLineDeclaration>;\n readonly accessPosture: LineAccessPostureOutcome | undefined;\n readonly applicationRoot: string;\n readonly domainPlan?: unknown;\n readonly dryRun: boolean;\n }): FoundationExecutionResult['organizationIdentity'] {\n if (input.lineDeclaration.state !== ApplicationLineDeclarationState.DECLARED) return undefined;\n if (!resolveLineAccessPosture(input.lineDeclaration.line).asksCorporateIdentity) return undefined;\n if (input.accessPosture?.ownerOrganizationTypeRef === undefined) return undefined;\n const corporateIdentity = input.accessPosture.corporateIdentity;\n if (corporateIdentity === undefined) {\n return { owed: [`The organization identity declaration (\\`backend-api/src/organization-identity.ts\\`) was not written: \\`${CORPORATE_IDENTITY_QUESTION.questionRef}\\` is unanswered, and its single sign-on posture follows from the answer. Answer it, and run the foundation again.`] };\n }\n try {\n return composeOwnerOrganizationIdentityDeclaration({\n applicationRoot: input.applicationRoot,\n corporateIdentity,\n ...(input.domainPlan === undefined ? {} : { domainPlan: input.domainPlan }),\n ...(input.dryRun ? { dryRun: true } : {}),\n });\n } catch (error) {\n return { owed: [`The organization identity declaration could not be written: ${describeCaughtError(error)}`] };\n }\n }\n\n /**\n * The systems of record the domain plan puts records in (#3039, foundation half), with the credentials each instance\n * will owe. The instance is the build's binding task's to declare, and the library follows it (see\n * `foundation-systems-of-record` in the creation runtime for why the foundation does not declare it).\n */\n private async declareSystemsOfRecord(domainPlan: unknown, applicationRoot: string): Promise<FoundationExecutionResult['systemsOfRecord']> {\n const needs = deriveSystemOfRecordNeeds(domainPlan);\n if (needs.length === 0) return [];\n const libraryDeclared = backendDeclaresSystemsOfRecordLibrary(applicationRoot);\n const facets = await this.loadSystemOfRecordFacets(applicationRoot);\n return needs.map((need) => ({ ...need, libraryDeclared, ...describeSystemOfRecordCredentialsOwed(need, facets) }));\n }\n\n /**\n * The application's EFFECTIVE facets keyed by vendor, a facet the engine's resolution refused carrying why, through the\n * one loader the domain-plan run and the build lane's landing check also read (`loadEffectiveSystemOfRecordFacets`,\n * #3052): the engine's own resolver over the recorded facet modules, so a credential kind a facet augmentation an\n * instance opted into offers is counted as the backend counts it (#3053). `undefined` when no facet module can be read:\n * the credentials are then reported owed with that reason, never guessed.\n */\n private async loadSystemOfRecordFacets(applicationRoot: string): Promise<Readonly<Record<string, SystemOfRecordVendorFacet | { readonly refused: string }>> | undefined> {\n const effective = await loadEffectiveSystemOfRecordFacets({\n applicationRoot,\n frameworkRoot: this.companionContext.resolvedHomes.framework.repositoryRoot ?? undefined,\n // Re-read, not the configuration the companion loaded at start: an instance declared since then counts.\n systemsOfRecord: await rereadDeclaredSystemOfRecordInstances(\n applicationRoot,\n (this.companionContext.saasConfig as { systemsOfRecord?: Record<string, SystemOfRecordInstanceFacetRequest | undefined> } | undefined)?.systemsOfRecord,\n (error) => this.logDebug('wildo.saas.config.ts could not be re-read; judging the systems of record the companion started with', { error: describeCaughtError(error) }),\n ),\n onUnreadable: (specifier, error) => this.logDebug('A system-of-record facet module could not be imported', { specifier, error: describeCaughtError(error) }),\n });\n if (effective === undefined) return undefined;\n return Object.fromEntries(Object.entries(effective.byVendor).map(([vendor, resolved]) => [vendor, 'refused' in resolved ? resolved : resolved.facet]));\n }\n\n /** The excluded capabilities the configuration enables anyway, each with the edit that settles it. */\n private findEngineCapabilitiesContradictingLine(\n applicationRoot: string,\n lineDeclaration: ReturnType<typeof resolveApplicationLineDeclaration>,\n ): FoundationExecutionResult['engineCapabilitiesContradictingLine'] {\n if (lineDeclaration.state !== ApplicationLineDeclarationState.DECLARED) return [];\n // Read off the line definition itself, the one source of what a line never has.\n const excluded = APPLICATION_LINE_DEFINITIONS[lineDeclaration.line].excludedEngineCapabilities;\n if (excluded.length === 0) return [];\n const filePath = join(applicationRoot, SAAS_CONFIG_FILE_NAME);\n const content = readFileSync(filePath, 'utf8');\n return excluded\n .filter((capability) => readEngineCapabilityEnabled({ filePath, content, capability }) === true)\n .map((capability) => ({\n capability,\n remedy: `The ${lineDeclaration.line} line never has ${capability}, and ${SAAS_CONFIG_FILE_NAME} enables it: set \\`engineCapabilities[EngineCapability.${capability}].enabled\\` to false (and remove its provider), or answer the line question again if the application is not a ${lineDeclaration.line}.`,\n }));\n }\n\n /**\n * An operator serving its clients (#2305): an organization type that owns the application, and an organization\n * relationship through which it serves the others. `wildo init --line service_firm` lays it down whole; on an\n * application whose line was chosen later it is laid down BESIDE what the configuration declares (#2968, the\n * runtime's `layDownOperatorWithClients` says exactly what is added and what is left out). What only the creator can\n * decide is reported owed, with nothing written.\n *\n * An organization's type is fixed when it is created, so after first boot an added owner type reaches no existing\n * organization until the operator's own is promoted into it: the steps are named in `afterFirstBoot`.\n */\n private layDownOperatorWithClients(\n decision: { readonly required: boolean; readonly basis: string; readonly structure?: ApplicationOrganizationStructure },\n applicationRoot: string,\n dryRun: boolean,\n organizationsEnabledByThisRun: boolean,\n ): NonNullable<FoundationExecutionResult['applicationOwnership']> {\n let layout: ReturnType<typeof layDownOperatorWithClients>;\n try {\n layout = layDownOperatorWithClients({ applicationRoot, ...(dryRun ? { dryRun: true } : {}), ...(decision.required ? { singleTypeOwnsApplication: true } : {}) });\n } catch (error) {\n return { ...decision, owed: `The operator-with-clients structure could not be laid down: ${describeCaughtError(error)}` };\n }\n const typeRef = layout.ownerTypeRef === undefined ? {} : { organizationTypeRef: layout.ownerTypeRef };\n if (layout.owed !== undefined) return { ...decision, ...typeRef, owed: layout.owed };\n // The structure is declared either way; with ORGANIZATIONS off it has no organizations to act on.\n // A dry run writes no capability, so ORGANIZATIONS this run would enable reads as off: not owed.\n const organizationsOwed = layout.organizationsCapabilityEnabled || organizationsEnabledByThisRun\n ? {}\n : { owed: 'ORGANIZATIONS is not enabled: the operator, its clients and the relationship between them are organizations, so enable `engineCapabilities[EngineCapability.ORGANIZATIONS]` for the structure to take effect.' };\n return {\n ...decision,\n ...typeRef,\n ...organizationsOwed,\n changed: layout.changed,\n summary: layout.changed ? layout.edits.join('; ') : 'The configuration already declares an operator serving its clients.',\n ...(layout.changed\n ? {\n afterFirstBoot: 'If this application has already been initialized, run `wildo config reapply-declaration` so the stored declaration carries the new types and relationship.'\n + (layout.ownerTypeAdded\n ? ` The organizations that exist keep their types, so the operator's own organization is promoted into \\`${layout.ownerTypeRef}\\` with \\`organizations.promoteToOwnerOrganization\\`, by a platform super-administrator who is a member of it, with a justification.`\n + ` \\`${layout.ownerTypeRef}\\` grants the user types and offers the roles of the type it copied, which the promotion requires; it still refuses an organization holding an unrevoked SCIM token when the two types disagree on \\`scimProvisioning\\`.`\n + ' The other organizations stay tenants and may now grant the relationship.'\n : '')\n + (layout.typesAdded.length > 0\n ? ` An organization stored WITHOUT a type is typed at boot from the declared types its members' user types fit; ${layout.typesAdded.map((ref) => `\\`${ref}\\``).join(' and ')} grant${layout.typesAdded.length === 1 ? 's' : ''} the same user types as an existing type, so the next boot cannot tell which it is and refuses, naming it. Let one boot run on the configuration as it was before this, so every existing organization carries its type.`\n : ''),\n }\n : {}),\n };\n }\n\n /**\n * Declare the organization type that owns the application when its line requires one (#1605), BEFORE\n * the first initialization: an organization's type is fixed when it is created, so declaring it after\n * boot would need `wildo config reapply-declaration` and the `organizations.promoteToOwnerOrganization`\n * door. With exactly one declared type the answer is unambiguous; with several it is authoring work,\n * so it is marked owed, never guessed.\n */\n private declareApplicationOwnership(\n decision: { readonly required: boolean; readonly basis: string; readonly structure?: ApplicationOrganizationStructure },\n applicationRoot: string,\n dryRun: boolean,\n /** Whether this run's capability plan enables ORGANIZATIONS (written before this step, except in a dry run). */\n organizationsEnabledByThisRun = false,\n ): NonNullable<FoundationExecutionResult['applicationOwnership']> {\n if (decision.structure === ApplicationOrganizationStructure.OPERATOR_WITH_CLIENTS) return this.layDownOperatorWithClients(decision, applicationRoot, dryRun, organizationsEnabledByThisRun);\n if (!decision.required) return decision;\n /*\n * #2305 review: a configuration a firm feature line shaped keeps its operator and clients after that line is\n * abandoned (nothing is removed). An owner already declared answers the question, so it is not re-asked; a serving\n * relationship nobody asks for any more is NAMED, because the dossier now says one owner while the configuration\n * still signs clients up (and the privacy notice, read from the dossier, would be addressed to the wrong readers).\n */\n const existing = readSaasConfigOperatorWithClients(applicationRoot);\n if (existing?.ownerTypeRef !== undefined) {\n return {\n ...decision,\n organizationTypeRef: existing.ownerTypeRef,\n changed: false,\n summary: `\\`${existing.ownerTypeRef}\\` already owns the application.`,\n ...(existing.servingRelationshipKey === undefined\n ? {}\n : { owed: `The configuration still serves clients through the \\`${existing.servingRelationshipKey}\\` relationship, while no line asks for the firm's structure any more. If the firm's features were abandoned, remove the relationship and the client organization types by hand; if not, reopen the feature line that needs the firm's method.` }),\n };\n }\n const organizationTypeRefs = listSaasConfigOrganizationTypeRefs({ applicationRoot });\n if (organizationTypeRefs.length !== 1) {\n return {\n ...decision,\n owed: organizationTypeRefs.length === 0\n ? 'The configuration declares no organization type; declare the one that owns the application, with `ownsApplication: true`.'\n : `The configuration declares ${organizationTypeRefs.length} organization types (${organizationTypeRefs.join(', ')}); `\n + 'mark the one that owns the application with `ownsApplication: true`.',\n };\n }\n const organizationTypeRef = organizationTypeRefs[0]!;\n const result = setOrganizationTypeOwnsApplication({ applicationRoot, organizationTypeRef, ownsApplication: true, ...(dryRun ? { dryRun: true } : {}) });\n /*\n * Declared NOW, the type reaches an application that has usually booted already (the line was chosen in the\n * interview, which runs on a started stack): the organization created at that boot keeps its type until the\n * documented door promotes it. An application created with `wildo init --line` or a line blueprint has it before\n * its first boot and this never fires (#1605).\n */\n return {\n ...decision,\n organizationTypeRef,\n changed: result.changed,\n summary: result.summary,\n ...(result.changed\n ? { afterFirstBoot: `If this application has already been initialized, its existing organization keeps the type it was created with: run \\`wildo config reapply-declaration\\`, then promote it with \\`organizations.promoteToOwnerOrganization\\`.` }\n : {}),\n };\n }\n\n /**\n * A landed family VALUE (the business model, the capability composition, the integration plan, the dossier), or\n * `undefined` when this application has none. Written for the business model, which the reasoning below names.\n *\n * ## Why the executor reads it rather than being handed it\n *\n * The run service resolves every landed family into one `artifactsByFamily` map and passes this\n * executor the domain plan alone. Widening that hand-off is the tidier change and it is NOT the one\n * made here: that file is being actively worked by another lane, and the export field this needs is\n * already named once in the semantic-authority bindings — so reading it through the SAME binding is\n * a second door onto one vocabulary rather than a second copy of it.\n *\n * ## Lenient about absence, never about what could not be read\n *\n * Absent answers `undefined`, and the derivation treats that as \"this decides nothing\".\n * `bottom_up.foundation` gates on `domain-plan` and `vision-brief` alone, so an eligible run legitimately has no\n * business model: refusing here would turn one of its OPTIONAL declared inputs into a precondition, which is the shape\n * `application-creation-directive.md` forbids.\n *\n * What could not be read is not absent, so it THROWS (#3258): a package that does not load, or a family a failed\n * module left unavailable. It used to answer `undefined` too, which silently shrank the derived capability set, and a\n * step owing nothing landed without running. Every caller decides what that means to it.\n */\n private async readLandedFamilyValue(family: 'domain-plan' | 'business-model' | 'capability-composition' | 'integration-plan' | 'creator-inputs'): Promise<unknown> {\n const binding = APPLICATION_SPECIFICATION_SEMANTIC_SCHEMA_BINDINGS.find((entry) => entry.family === family);\n if (binding?.companionExportsField === undefined) return undefined;\n // No specifications package is a legitimate state, with nothing landed in it.\n if (this.companionContext.resolvedSpecifications == null) return undefined;\n const exports = await loadSpecificationFamilyData(this.companionContext);\n return (exports as unknown as Record<string, unknown>)[binding.companionExportsField] ?? undefined;\n }\n\n /**\n * Every application-relative target a scenario invocation would write or edit, planned exactly as a dry run plans it\n * and never applied (#3237 review H1): for an invocation found already composed, what the run still composes. A plan\n * that cannot be made (a collision, a missing scenario) names nothing: the witness directory still stands for it.\n */\n private planInvocationTargets(input: {\n readonly invocation: FoundationScenarioInvocation;\n readonly applicationRoot: string;\n readonly scenarioDirectoriesByRef: ReadonlyMap<string, string>;\n readonly renderer: CompositionTemplateRenderer;\n }): readonly string[] {\n const scenarioDirectory = input.scenarioDirectoriesByRef.get(input.invocation.scenarioRef);\n if (!scenarioDirectory) return [];\n try {\n const scenario = loadCompositionScenario(scenarioDirectory);\n const variables = resolveCompositionScenarioVariables(scenario.manifest, { ...input.invocation.variables });\n const plan = planCompositionScenario({ scenario, applicationRoot: input.applicationRoot, variables, renderer: input.renderer });\n return [...plan.writes, ...plan.skipped, ...plan.edits, ...plan.skippedEdits].map((entry) => entry.targetRelativePath);\n } catch (error) {\n this.logDebug('An already-composed scenario could not be planned; its witness directory stands for it', { scenarioRef: input.invocation.scenarioRef, error: describeCaughtError(error) });\n return [];\n }\n }\n\n private applyInvocation(input: {\n readonly invocation: FoundationScenarioInvocation;\n readonly applicationRoot: string;\n readonly scenarioDirectoriesByRef: ReadonlyMap<string, string>;\n readonly renderer: CompositionTemplateRenderer;\n readonly dryRun: boolean;\n /** Told each file the applied scenario writes or edits (#3237). */\n readonly noteWrite?: (filePath: string) => void;\n }): FoundationScenarioExecutionRecord {\n const scenarioDirectory = input.scenarioDirectoriesByRef.get(input.invocation.scenarioRef);\n if (!scenarioDirectory) {\n throw new FoundationExecutionError(\n `The \"${input.invocation.scenarioRef}\" composition scenario is not available to this application `\n + '(neither the app-delivered templates nor a framework checkout carries it).',\n );\n }\n const scenario = loadCompositionScenario(scenarioDirectory);\n const variables = resolveCompositionScenarioVariables(scenario.manifest, { ...input.invocation.variables });\n const plan = planCompositionScenario({ scenario, applicationRoot: input.applicationRoot, variables, renderer: input.renderer });\n const subject = input.invocation.variables['resourceDir']\n ? `${input.invocation.variables['moduleId']}/${input.invocation.variables['resourceDir']}`\n : input.invocation.variables['moduleId'] !== undefined\n ? String(input.invocation.variables['moduleId'])\n : (COMPOSED_WITNESS_DIRECTORY[input.invocation.scenarioRef]?.(input.invocation.variables) ?? input.invocation.scenarioRef);\n if (plan.collisions.length > 0) {\n // The engine's never-half-apply invariant: a collision means the application EDITED a target\n // this scenario would rewrite. Refusing with the paths is the honest outcome — the creator\n // reconciles (git is the undo), then re-runs; foundation never overwrites authored work.\n throw new FoundationExecutionError(\n `Composing ${input.invocation.scenarioRef} for ${subject} collides with existing application files: `\n + plan.collisions.join(', ')\n + ' — reconcile them (the application owns those bytes) and re-run.',\n );\n }\n if (!input.dryRun) {\n // Named BEFORE the apply, so an apply that fails part-way still declares what it may have written (#3237 review N3).\n // A named file the apply never reached changed nothing, and the landing records only what changed.\n for (const write of plan.writes) input.noteWrite?.(write.targetRelativePath);\n for (const edit of plan.edits) input.noteWrite?.(edit.targetRelativePath);\n applyCompositionScenarioPlan({ plan, applicationRoot: input.applicationRoot });\n }\n return {\n scenarioRef: input.invocation.scenarioRef,\n subject,\n writes: plan.writes.length,\n skippedWrites: plan.skipped.length,\n editsApplied: plan.edits.length,\n skippedEdits: plan.skippedEdits.length,\n };\n }\n\n /**\n * The tenancy model, from the PLAN first and the interview second.\n *\n * The plan wins because it is the committed artifact: a creator who answered the question on\n * `bottom_up.domain-plan` has already had that answer shape the modules and relationships, and\n * re-asking here would let a second answer contradict a model built on the first.\n *\n * The elicitation fallback stays for plans authored before `tenancy` existed on the family schema\n * (wonder-crm and wonder-todos are both such plans). Neither source present is still a refusal:\n * the executor deliberately does not derive this.\n */\n private resolvePrimaryScope(\n domainPlan: unknown,\n answers: ReadonlyArray<{ readonly questionRef: string; readonly answer: string }>,\n ): FoundationPrimaryScope {\n const parsed = DomainPlanOutputSetSchema.safeParse(domainPlan);\n if (parsed.success && parsed.data.tenancy !== undefined) return parsed.data.tenancy;\n const answer = answers.find((candidate) => candidate.questionRef === 'primary-scope')?.answer?.trim();\n if (answer === FoundationPrimaryScope.ORGANIZATIONS || answer === FoundationPrimaryScope.USERS) return answer;\n throw new FoundationExecutionError(\n 'The tenancy model is a creator decision the executor deliberately does not derive, and neither '\n + 'source supplied it: the domain plan carries no `tenancy`, and no \"primary-scope\" elicitation '\n + 'answer (\"organizations\" or \"users\") was given.'\n + (answer ? ` Received answer: \"${answer}\".` : ''),\n );\n }\n\n private readSharedLibPackageName(applicationRoot: string): string {\n const manifestPath = join(applicationRoot, 'shared-lib', 'package.json');\n try {\n const name = (JSON.parse(readFileSync(manifestPath, 'utf8')) as { name?: string }).name;\n if (name) return name;\n } catch {\n // fall through to the named refusal below\n }\n throw new FoundationExecutionError(`Cannot read the shared-lib package name at ${manifestPath} — not a composed application root.`);\n }\n\n /**\n * Whether the landed integration plan declares a minion — read leniently, because an unparseable\n * plan declares nothing and the derivation reads it the same way.\n */\n private declaresAMinion(integrationPlan: unknown): boolean {\n const minions = (integrationPlan as { minions?: unknown } | null)?.minions;\n return Array.isArray(minions) && minions.length > 0;\n }\n\n /**\n * The backend-api package name — a minion's package re-derives the application's initialization\n * from it, so `add-minion` binds it as a variable. Read the same way as the shared-lib name, and\n * refusing the same way: a composed application root has both, and a minion composed against a\n * guessed package name produces a package that cannot resolve its own initialization.\n */\n private readBackendApiPackageName(applicationRoot: string): string {\n const manifestPath = join(applicationRoot, 'backend-api', 'package.json');\n try {\n const name = (JSON.parse(readFileSync(manifestPath, 'utf8')) as { name?: string }).name;\n if (name) return name;\n } catch {\n // fall through to the named refusal below\n }\n throw new FoundationExecutionError(`Cannot read the backend-api package name at ${manifestPath} — not a composed application root.`);\n }\n}\n"]}
1
+ {"version":3,"file":"foundation-executor.companion.service.js","sourceRoot":"","sources":["../../../../src/meta-workflows/services/foundation-executor.companion.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,cAAc,EAAE,iCAAiC,EAAwB,MAAM,+BAA+B,CAAC;AAC/L,OAAO,EAAE,2BAA2B,EAAE,MAAM,4CAA4C,CAAC;AAEzF,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EACL,4BAA4B,EAC5B,+BAA+B,EAC/B,2BAA2B,EAC3B,wBAAwB,EACxB,gCAAgC,EAChC,sBAAsB,EACtB,yBAAyB,EACzB,iCAAiC,GAElC,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAErF,OAA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K,yBAAyB,CAAC,eAAuB;QACvD,MAAM,YAAY,GAAG,IAAI,CAAC,eAAe,EAAE,aAAa,EAAE,cAAc,CAAC,CAAC;QAC1E,IAAI,CAAC;YACH,MAAM,IAAI,GAAI,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC,CAAuB,CAAC,IAAI,CAAC;YACxF,IAAI,IAAI;gBAAE,OAAO,IAAI,CAAC;QACxB,CAAC;QAAC,MAAM,CAAC;YACP,0CAA0C;QAC5C,CAAC;QACD,MAAM,IAAI,wBAAwB,CAAC,+CAA+C,YAAY,qCAAqC,CAAC,CAAC;IACvI,CAAC;CACF,CAAA;AArlCY,kCAAkC;IAD9C,UAAU,EAAE;IAKR,WAAA,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAA;IACjC,WAAA,MAAM,CAAC,uBAAuB,CAAC,gBAAgB,CAAC,CAAA;;GALxC,kCAAkC,CAqlC9C","sourcesContent":["import { execFile } from 'node:child_process';\nimport { existsSync, readFileSync } from 'node:fs';\nimport { basename, isAbsolute, join, relative, sep } from 'node:path';\nimport { promisify } from 'node:util';\n\nimport { BlueprintDeclarationFile, dataServingProviderRefs, loadInfraEnvConfig, loadSaasConfig, resolveProviderComplianceProfiles, type WildoSaasConfig } from '@wildo-ai/platform-config-lib';\nimport { withDependencyInstallRecord } from '@wildo-ai/platform-core-shared/dev-runtime';\n\nimport { inject, injectable } from 'inversify';\nimport {\n APPLICATION_LINE_DEFINITIONS,\n ApplicationLineDeclarationState,\n CORPORATE_IDENTITY_QUESTION,\n resolveLineAccessPosture,\n ApplicationOrganizationStructure,\n CompositionScenarioRef,\n DomainPlanOutputSetSchema,\n resolveApplicationLineDeclaration,\n type ApplicationCreatorInputs,\n} from '@wildo-ai/saas-specifications/application-creation';\nimport { SAAS_SERVICE_TYPES, describeCaughtError } from '@wildo-ai/saas-backend-lib';\nimport type { LoggerService } from '@wildo-ai/saas-backend-lib';\nimport { propagateAcceptedBrand, type CompanionBrandPropagation } from '../../brand/services/brand-propagation.companion.utils';\nimport { AppFrontendType, JurisdictionSlugListReadingKind, ProviderOriginKind, engineCapabilityResolutionModeTakesASelection, getEngineCapabilityResolutionMode, EngineCapability, parseJurisdictionSlugList } from '@wildo-ai/saas-models';\nimport { AvailableLanguage, languagePathSegment } from '@wildo-ai/saas-models/public-runtime';\nimport { engineProviderSpecifications } from '@wildo-ai/saas-specifications';\nimport type { SystemOfRecordVendorFacet } from '@wildo-ai/saas-models/external-data';\nimport { loadEffectiveSystemOfRecordFacets, rereadDeclaredSystemOfRecordInstances, type SystemOfRecordInstanceFacetRequest } from './system-of-record-facet-library.companion.utils';\n\nimport {\n APPLICATION_SPECIFICATION_SEMANTIC_SCHEMA_BINDINGS,\n addProviderToScope,\n applyCompositionScenarioPlan,\n createCompositionTemplateRenderer,\n deriveEngineCapabilityPlan,\n deriveFoundationCompositionPlan,\n readEngineCapabilityEnabled,\n SAAS_CONFIG_FILE_NAME,\n type FoundationCompositionPlan,\n creatorProviderAnswerFor,\n FoundationPrimaryScope,\n listCompositionScenarioDirectories,\n loadCompositionScenario,\n planCompositionScenario,\n ProviderPackageLinksService,\n linkableFrameworkCheckout,\n readDeliveredOptInFrameworkPackages,\n resolveCompositionScenarioVariables,\n setEngineCapabilityEnabled,\n setProviderSelectionPrimary,\n type CompositionTemplateRenderer,\n type FoundationCapabilityBasis,\n type FoundationBackgroundExecutionOutcome,\n type FoundationCompositionScenarioOutcome,\n type FoundationHostFacts,\n type FoundationScenarioInvocation,\n layDownOperatorWithClients,\n applyLineAccessPosture,\n resolveCorporateIdentity,\n describeOwnerNamingDifference,\n renameOwnerToDomainPlanNames,\n type LineAccessPostureOutcome,\n composeOwnerOrganizationIdentityDeclaration,\n type OrganizationIdentityDeclarationComposition,\n backendDeclaresSystemsOfRecordLibrary,\n deriveSystemOfRecordNeeds,\n describeSystemOfRecordCredentialsOwed,\n type FoundationSystemOfRecordCredentials,\n type FoundationSystemOfRecordNeed,\n readSaasConfigOperatorWithClients,\n listSaasConfigOrganizationTypeRefs,\n setOrganizationTypeOwnsApplication,\n ORGANIZATION_IDENTITY_DECLARATION_FILE,\n propagateBrandAssets,\n DATA_RESIDENCY_TERRITORIES_QUESTION_REF,\n OPERATING_ENTITY_QUESTION_REF,\n OPERATING_JURISDICTIONS_QUESTION_REF,\n applyFoundationOperatorDeclarations,\n planFoundationOperatorDeclarations,\n type FoundationOperatorDeclarationsOutcome,\n FoundationDataResidencyState,\n applyFoundationDataResidency,\n planFoundationDataResidency,\n type FoundationDataResidencyOutcome,\n} from '@wildo-ai/application-creation-runtime';\n\nimport { COMPANION_SERVICE_TYPES } from '../../core/inject/models/service-types';\nimport type { CompanionContext } from '../../core/context/companion-context';\nimport { assertSpecificationsReadWhole } from '../../core/context/companion-package-loaders.companion';\nimport { loadSpecificationFamilyData } from '../../core/context/specification-family-data.companion';\n\n/**\n * The foundation playbook's EXECUTOR — the domain-plan → compose bridge, run instead of typed by\n * hand (J-1 stall F: a human read the approved domain plan, decided the `wildo compose` calls and\n * the ORGANIZATIONS flip, derived every scenario variable, and ran them one by one).\n *\n * `bottom_up.foundation` declares `outputs: []` and `executor: \"composite\"`: it lands no\n * specification family — its deliverable is the APPLICATION (config + composed module slices).\n * The generation route therefore cannot run it (J-1 stall E); this service is what does.\n *\n * The derivation is PURE (`deriveFoundationCompositionPlan`, tested against a literal domain\n * plan); this service supplies the host facts (app root, framework root, the shared-lib package\n * name) and executes: the capability mutation through the config-mutation service, and each\n * scenario through the same engine + THE SAME renderer `wildo compose` uses — identical scenario\n * bytes produce identical files regardless of which door applied them.\n *\n * Idempotent by the engine's own contract: a re-run plans byte-identical targets as SKIPS; a\n * target that exists with DIFFERENT bytes is a collision and the whole scenario REFUSES unapplied\n * (ownership transferred to the application; git is the undo). Nothing here commits — GUIDED\n * acceptance stays a human `git commit`.\n */\n\nexport interface FoundationScenarioExecutionRecord {\n readonly scenarioRef: string;\n /** The invocation's addressing variables (moduleId, resourceDir) — enough to identify the unit. */\n readonly subject: string;\n readonly writes: number;\n readonly skippedWrites: number;\n readonly editsApplied: number;\n readonly skippedEdits: number;\n /**\n * DRY-RUN only: this invocation could not be PLANNED because it edits files a preceding\n * invocation of the same run would create (an add-resource whose module is composed by this\n * run's own add-module). A real run applies sequentially and never hits this; a dry run reports\n * the dependency honestly instead of failing on it.\n */\n readonly deferredBehindModuleComposition?: true;\n /**\n * A scenario whose witness already exists — a package (the website, a minion), a module, a resource, or a\n * locale's label pack (#3453), composed by an earlier run or by the build since — so this run left it alone. Applying it would either skip every\n * byte-identical file (a no-op reported as writes) or refuse on the first authored one, and neither is\n * what a re-run means: the composition says the application HAS a website, and it does.\n */\n readonly alreadyComposed?: true;\n}\n\n/** The composition scenarios that create a surface serving the brand's icons and social image. */\nconst SURFACES_RECEIVING_THE_BRAND: ReadonlySet<string> = new Set<string>([\n CompositionScenarioRef.ADD_WEBSITE,\n CompositionScenarioRef.ADD_TECHNICAL_DOC,\n]);\n\n/** Whether this run composed — actually wrote, not found already composed — a surface that serves the brand. */\nexport function composedASurfaceReceivingTheBrand(scenarios: readonly Pick<FoundationScenarioExecutionRecord, 'scenarioRef' | 'writes' | 'alreadyComposed'>[]): boolean {\n return scenarios.some((record) => SURFACES_RECEIVING_THE_BRAND.has(record.scenarioRef) && record.alreadyComposed !== true && record.writes > 0);\n}\n\n/** One dependency install the foundation ran after changing a package manifest (#3204). */\nexport interface FoundationDependencyInstall {\n readonly succeeded: boolean;\n /** The manifests this run wrote that made the install owed, application-relative. */\n readonly manifests: readonly string[];\n readonly durationMs: number;\n /** The tail of what pnpm reported, when it failed. */\n readonly error?: string;\n}\n\n/**\n * Bound on the install: a cold store downloads a documentation toolchain (Docusaurus) in a few minutes, and a hung\n * registry must not hold the foundation run, and the build after it, for good.\n */\nconst FOUNDATION_DEPENDENCY_INSTALL_TIMEOUT_MS = 15 * 60 * 1000;\n\nexport interface FoundationExecutionResult {\n readonly playbookRef: 'bottom_up.foundation';\n readonly primaryScope: FoundationPrimaryScope;\n readonly engineCapabilityChanges: ReadonlyArray<{\n readonly capability: string;\n /** WHICH declaration decided it — so the record says why, not merely what (#1272). */\n readonly basis: FoundationCapabilityBasis;\n readonly changed: boolean;\n readonly summary: string;\n /**\n * Set when this run also DECLARED a provider so the capability could be enabled at all.\n *\n * Carried loudly rather than folded into the summary, because a credential-free provider is a\n * DEVELOPMENT SUBSTITUTE by construction — `email-preview` renders mail to a local surface and\n * its own module says to \"wire it as the `EMAIL_TRANSACTIONAL` primary in local environments…\n * with no live API key and no mail actually leaving the machine\". The application is configured\n * and working; replacing it is a deployment decision somebody still owes, and a record that did\n * not say so would let it ship unnoticed.\n *\n * spec-cite: N/A — INTERNAL. The quotation is this repository's own\n * `engine/external-connectors-private/src/providers/email-preview/email-preview.backend.module.ts`\n * module JSDoc, not an external standard. An earlier revision quoted \"never select it as primary\n * in an environment that serves real users\", which appears in no specification anywhere — a\n * paraphrase wearing quotation marks, the exact shape\n * `.claude/rules/external-specification-citations.md` exists to retire.\n */\n readonly servedByDeclaredProvider?: {\n readonly providerRef: string;\n readonly developmentSubstitute: true;\n readonly replaceBeforeRealUsers: string;\n };\n /**\n * The provider the CREATOR chose in the foundation interview (#1488), declared, selected and enabled\n * by this run. `credentialsOwed` names the env vars the provider requires and this process cannot\n * supply: the application boots (the floor reads declaration + selection), and the provider's own\n * calls fail until an operator sets them. Mark, never gate.\n */\n readonly servedByCreatorSelectedProvider?: {\n readonly providerRef: string;\n readonly credentialsOwed: ReadonlyArray<{ readonly envVarName: string; readonly description: string }>;\n readonly remedy: string;\n };\n }>;\n /**\n * Capabilities the application NEEDS and this run deliberately did not enable, because the engine\n * refuses to boot with them on and no provider resolving, and the journey cannot declare one.\n *\n * Reported rather than silently dropped: a derivation whose result nobody can see is a derivation\n * nobody acts on, and the remedy — declare a provider for it — is a sentence an operator can act\n * on today. `application-creation-directive.md`: mark, never gate.\n */\n readonly engineCapabilitiesOwedAProvider: ReadonlyArray<{\n readonly capability: string;\n readonly basis: FoundationCapabilityBasis;\n readonly remedy: string;\n }>;\n readonly scenarios: readonly FoundationScenarioExecutionRecord[];\n /** The accepted brand mark copied into a surface this run composed (a website, a portal). Absent when none was composed. */\n readonly brandPropagation?: CompanionBrandPropagation;\n /**\n * How this application's organizations are arranged, and what this run declared for it (#1605, #2305).\n * `owed` is set when a single-owner line's configuration does not name one organization type unambiguously, when\n * the operator-with-clients structure cannot be laid down beside the configuration's types without the creator's\n * choice (#2968: several types and no owner, computed type keys, both relationship names taken), or when it was laid\n * down and ORGANIZATIONS is still off: marked, never gated, since all are authoring work.\n */\n readonly applicationOwnership?: {\n readonly required: boolean;\n readonly basis: string;\n /** How the line arranges the organizations (#2305). */\n readonly structure?: ApplicationOrganizationStructure;\n readonly organizationTypeRef?: string;\n readonly changed?: boolean;\n readonly summary?: string;\n readonly owed?: string;\n /** Set when this run declared ownership: what an application that booted BEFORE it still owes (the promotion door). */\n readonly afterFirstBoot?: string;\n };\n /**\n * Capabilities the application's line says it never has, which its configuration enables anyway (#1605): an\n * internal tool with billing on. Reported, never switched off and never refused (`application-creation-directive.md`):\n * turning a capability off is the person's edit, and the remedy names it. Empty when the configuration agrees.\n */\n readonly engineCapabilitiesContradictingLine: ReadonlyArray<{ readonly capability: EngineCapability; readonly remedy: string }>;\n /**\n * The access posture the line gives the application (#3037), when it gives one: the registration mode of the owner's\n * user types (an internal tool's people are invited or provisioned, never self-registered) and, once the company has\n * answered `corporate-identity`, the enterprise sign-in methods, SCIM provisioning and the features their doors need.\n * `owed` lists what could not be written, each with its remedy; absent when the line decides nothing (a B2B SaaS, a\n * service firm, no line yet) or the organizations are not arranged as a single owner.\n */\n readonly accessPosture?: LineAccessPostureOutcome;\n /**\n * The owner organization's identity declaration (#3043): `backend-api/src/organization-identity.ts`, derived from the\n * `corporate-identity` answer and passed to startup as `organizationIdentity`, which the backend applies at every boot\n * (#3038). The single sign-on posture follows from the answer; the company's units and its directory's department →\n * unit mapping are named by nothing the creation lane holds, so they are `owed`, never invented. `owed` alone, with\n * nothing composed, when the answer is missing. Absent when no line is declared, on a line that does not ask for the\n * corporate identity, and when the access posture found no owner organization type (it is not laid down for an\n * operator serving clients, and its own `owed` names a missing owner).\n */\n readonly organizationIdentity?: OrganizationIdentityDeclarationComposition | { readonly owed: readonly string[] };\n /**\n * The systems of record the domain plan puts records in (#3039), each with the resources it holds and the credentials\n * its instance will owe, named as the backend reads them. `owed` says why credentials could not be named (an unknown\n * kind, an unread facet library, a credential kind the company chooses). The facet library (`@wildo-ai/systems-of-record`,\n * opt-in) is declared and linked by the CLI once the build declares the instance; `libraryDeclared` says whether the\n * backend declares it already. Empty when every resource's records are the application's own.\n */\n readonly systemsOfRecord: ReadonlyArray<FoundationSystemOfRecordNeed & FoundationSystemOfRecordCredentials & { readonly libraryDeclared: boolean }>;\n /**\n * What the capability composition decided, scenario by scenario (#1491): every scenario applied and every\n * scenario declined, with the declaration each came from. Empty when no composition has landed yet.\n */\n readonly compositionScenarios: readonly FoundationCompositionScenarioOutcome[];\n /**\n * What the run read about workers and minions (#1544): composed, declared none, or had no readable\n * integration plan to read. The last two used to be one silence.\n */\n readonly backgroundExecution: FoundationBackgroundExecutionOutcome;\n /** The host facts the optional-package scenarios were composed with, and where the public domain came from. */\n readonly hostFacts?: FoundationHostFacts & { readonly publicDomainSource: string };\n /**\n * Every file this run WROTE, application-root-relative and POSIX (#3237): each configuration edit a step reported as\n * a change, each composed scenario's writes and edits, the organization identity declaration and its wiring, and the\n * brand files propagated to a surface composed now. The run's write record is computed from these, never from\n * everything that changed in the tree while it ran: a coding agent writing in the same seconds is not the\n * foundation, and its work must not be accepted under the foundation's name. Empty on a dry run.\n */\n readonly writtenPaths: readonly string[];\n /**\n * What this run still COMPOSES without writing it again (application-relative files and directories): every target a\n * scenario its plan asks for and found already composed would write or edit (planned, never applied, so a module's\n * four trees and its registry, barrel and companion-exports edits are all here), and each configuration file an edit\n * found already in place. A completed run's landing adopts what a failed run left there (#3237 review F4, H1). Empty\n * on a dry run.\n */\n readonly stillComposedPaths: readonly string[];\n /**\n * The dependency install this run owed (#3204): run when it wrote a package manifest or the workspace file, absent when\n * it wrote neither. A failure is reported here and the run still lands, because the remedy is an install, not a\n * different composition.\n */\n readonly dependencyInstall?: FoundationDependencyInstall;\n /**\n * The application's data residency (#2294), from the `data-residency-territories` answer: what was written\n * (`operatorComplianceIdentity.dataResidency` and each provider region the residency leaves no choice about) and what\n * is left open. The residency is written only once every data-serving provider is placed inside it; until then\n * `advisory` and `unplacedProviders` say why, and `wildo context launch-blockers` lists each provider. Marked, never\n * gated: an unanswered question writes nothing and travels here as an advisory.\n */\n readonly dataResidency?: FoundationDataResidencyOutcome;\n /**\n * The operator's identity parts and operating jurisdictions (#2294 follow-up), from the `operating-entity` and\n * `operating-jurisdictions` answers: each part or jurisdiction the configuration lacked, written; an authored value that\n * differs, kept and named in `advisories`; an unanswered or unreadable answer, nothing written and named likewise.\n * Absent only when the configuration could not be read, which `advisory` then says.\n */\n readonly operatorDeclarations?: FoundationOperatorDeclarationsOutcome | { readonly advisory: string };\n}\n\n/**\n * An engine provider this run may declare on the application's behalf, without asking anyone.\n *\n * ## The criterion is an EMPTY SECRETS CONTRACT, and that is the whole of it\n *\n * A capability in `ENGINE_CAPABILITIES_REQUIRING_A_PROVIDER_WHEN_ENABLED` cannot be enabled without\n * a provider — the backend refuses to boot. Choosing one is usually a commercial decision nobody in\n * this process is entitled to take: which payment processor, which mail vendor, on whose account.\n *\n * But a provider that declares NO SECRETS needs no account, so choosing it commits the operator to\n * nothing they can be billed or bound by. Measured across the whole engine catalogue (2026-09-17),\n * exactly two providers qualify, and only one of them serves a boot-floor capability:\n *\n * | provider | secrets | serves |\n * |---|---|---|\n * | `email-preview` | none | EMAIL_TRANSACTIONAL |\n * | `opencode` | none | AI_CODING_AGENT — not in the boot floor, and not derived by the journey |\n *\n * `stripe`, `twilio`, `resend` and every AI vendor carry a secrets contract, so BILLING and SMS stay\n * OWED. That asymmetry is the point rather than a limitation: the journey configures what costs\n * nothing to configure and leaves the commercial choices to the human who owns them.\n *\n * ## It is DERIVED from the specifications, never listed here\n *\n * A hand-kept list of another catalogue's contents is the shape that rots — the same argument the\n * build task's workspace scope makes. A provider that drops its secrets contract tomorrow becomes\n * eligible the day it does, and one that grows a secrets contract stops being, with no edit here.\n */\nexport interface SelfConfiguringProviderChoice {\n readonly providerRef: string;\n readonly providerCapabilities: readonly string[];\n readonly protocols: readonly string[];\n}\n\nexport function resolveCredentialFreeEngineProvider(capability: EngineCapability): SelfConfiguringProviderChoice | undefined {\n const candidates = Object.values(engineProviderSpecifications).filter((specification) => (\n specification.engineCapabilities.includes(capability)\n && specification.secretsContract.length === 0\n && specification.origin.kind === ProviderOriginKind.ENGINE\n // A backend-scope declaration is what the boot floor reads; a frontend-only module cannot serve it.\n && specification.facets.includes('backend')\n ));\n /*\n * Exactly one, or none. Two credential-free providers for one capability would be a CHOICE, and a\n * choice is the thing this function exists not to make on somebody's behalf — so it declines and\n * the capability stays owed, which is the outcome a human can still resolve.\n */\n if (candidates.length !== 1) return undefined;\n const chosen = candidates[0]!;\n return {\n providerRef: chosen.ref,\n providerCapabilities: chosen.providerCapabilities,\n protocols: chosen.protocols,\n };\n}\n\n/** Refusals a creator can act on (missing scope answer, unwired domain plan, collisions). */\n/**\n * The engine providers a creator may be OFFERED for a capability: ENGINE-origin, backend-scoped, serving it\n * (#1488). This is the options vocabulary of the foundation interview's provider questions, and the test\n * beside this file pins the AUTHORED options to it, so a vendor added to the catalogue is offered by being\n * added rather than by somebody remembering the question.\n */\nexport function listEngineProviderRefsServing(capability: EngineCapability): readonly string[] {\n return Object.values(engineProviderSpecifications)\n .filter((specification) => (\n specification.engineCapabilities.includes(capability)\n && specification.origin.kind === ProviderOriginKind.ENGINE\n && specification.facets.includes('backend')\n ))\n .map((specification) => specification.ref)\n .sort();\n}\n\nexport type CreatorSelectedProviderResolution =\n | {\n readonly kind: 'selected';\n readonly providerRef: string;\n readonly providerCapabilities: readonly string[];\n readonly protocols: readonly string[];\n /** The provider's REQUIRED secrets, by env var — what the operator still owes before it answers. */\n readonly credentialsOwed: ReadonlyArray<{ readonly envVarName: string; readonly description: string }>;\n }\n | {\n /** The creator named something the catalogue does not offer for this capability. Reported, never guessed around. */\n readonly kind: 'refused';\n readonly reason: string;\n };\n\n/**\n * The creator's provider choice for a capability, read off the foundation interview (#1488).\n *\n * `undefined` when the question was not answered or answered `none` (`PROVIDER_CHOICE_NONE`) — the honest\n * value: the interview requires an answer to every question, so \"decide later\" is an option, and it leaves\n * the capability OWED exactly as before (#1272). An answer outside the offered set is `refused` with the set\n * named. **That arm is a floor for DIRECT callers, not a run path**: through `runPlaybook` the interview\n * validator (`validateElicitationAnswer`) refuses an out-of-options answer before the executor is called, and\n * the compiled options are pinned to this very derivation, so a run never reaches it. Secrets are not checked\n * here: the boot floor reads declaration and selection, so the chosen provider can be declared and the\n * capability enabled while the credentials stay OWED.\n */\nexport function resolveCreatorSelectedEngineProvider(\n capability: EngineCapability,\n answers: ReadonlyArray<{ readonly questionRef: string; readonly answer: string }>,\n): CreatorSelectedProviderResolution | undefined {\n const answer = creatorProviderAnswerFor(capability, answers);\n if (answer === undefined) return undefined;\n const offered = listEngineProviderRefsServing(capability);\n const chosen = Object.values(engineProviderSpecifications).find((specification) => specification.ref === answer);\n if (!chosen || !offered.includes(answer)) {\n return {\n kind: 'refused',\n reason: `The interview answer \"${answer}\" names no engine provider serving ${capability}. Offered: ${offered.join(', ') || '(none)'}.`,\n };\n }\n return {\n kind: 'selected',\n providerRef: chosen.ref,\n providerCapabilities: chosen.providerCapabilities,\n protocols: chosen.protocols,\n credentialsOwed: chosen.secretsContract\n .filter((secret) => secret.required)\n .map((secret) => ({ envVarName: secret.envVarName, description: secret.description })),\n };\n}\n\n/** What {@link FoundationExecutorCompanionService.deriveSatisfiableEngineCapabilityPlan} answers (#2497). */\nexport interface SatisfiableEngineCapabilityPlan {\n readonly plan: Pick<FoundationCompositionPlan, 'engineCapabilityChanges' | 'engineCapabilitiesOwedAProvider'>;\n /** Every capability in the plan, in order: what the `engine-capabilities` step must leave enabled to land. */\n readonly capabilities: readonly EngineCapability[];\n}\n\n/** What the build lane's `engine-capabilities` step did (#2497). */\nexport interface EngineCapabilityAlignmentResult extends Pick<FoundationExecutionResult, 'engineCapabilityChanges' | 'engineCapabilitiesOwedAProvider'> {\n /** `false` when no domain plan with a tenancy has landed, so nothing could be derived. */\n readonly derived: boolean;\n readonly capabilities: readonly EngineCapability[];\n}\n\nexport class FoundationExecutionError extends Error {}\n\n/**\n * The path whose presence says a scenario has ALREADY been composed — its WITNESS: a directory, or for a locale\n * its label pack. Total over the vocabulary; `null` means the scenario has no path of its own (a custom operation,\n * a provider block) and is never skipped on that ground.\n *\n * Modules and resources have witnesses too (#1544), and that is what makes the foundation re-runnable\n * once the build has started. With `null` for both, every re-run re-planned `add-module` and\n * `add-resource` from scratch and collided with the files the build's own tasks had written since —\n * seven of them on the first end-to-end run — and a diverged target refuses the whole scenario, so the\n * run never reached the minion it was re-run for. A module whose directory exists was composed; the\n * build owns its bytes from then on, and re-composing it can only overwrite or refuse.\n *\n * A FUNCTION of the invocation's own variables, not a constant, because three of them compose one\n * package PER SURFACE (#1496's review): a worker lands in `workers/<workerDir>` and a minion in\n * `minions/<minionDir>`, so a fixed string cannot say whether THIS minion is already there.\n *\n * Getting that wrong was not cosmetic. `add-minion` appends the deny-all `resourceAccess` whitelist\n * verbatim, and the append REFUSES a key already present with a different value — so once a minion's\n * build task widened the whitelist, as its own design requires, the next foundation run died on that\n * minion and never reached the second one. Measured against the real scenario and apply pipeline.\n */\nconst COMPOSED_WITNESS_DIRECTORY: Readonly<Record<CompositionScenarioRef, ((variables: Readonly<Record<string, string>>) => string | null) | null>> = {\n [CompositionScenarioRef.ADD_MODULE]: (variables) => `shared-lib/src/modules/${variables['moduleId']}`,\n [CompositionScenarioRef.ADD_RESOURCE]: (variables) => `shared-lib/src/modules/${variables['moduleId']}/resources/${variables['resourceDir']}`,\n [CompositionScenarioRef.ADD_CUSTOM_OPERATION]: null,\n [CompositionScenarioRef.ADD_WEBSITE]: () => 'website',\n [CompositionScenarioRef.ADD_WEBSITE_SECTION]: null,\n [CompositionScenarioRef.ADD_MARKETING_PAGE]: null,\n [CompositionScenarioRef.ADD_TECHNICAL_DOC]: () => 'technical-doc',\n [CompositionScenarioRef.ADD_MINION]: (variables) => `minions/${variables['minionDir']}`,\n [CompositionScenarioRef.ADD_WORKER_NODE]: (variables) => `workers/${variables['workerDir']}`,\n [CompositionScenarioRef.ADD_WORKER_RUST]: (variables) => `workers/${variables['workerDir']}`,\n [CompositionScenarioRef.ADD_PROVIDER]: null,\n [CompositionScenarioRef.ADD_FILE_PICKER_PROVIDER]: null,\n [CompositionScenarioRef.ADD_ENVIRONMENT]: null,\n /*\n * A locale is registered once its label pack exists (#3453). `add-locale` writes the pack, the starter hero and the\n * landing route, and registers the locale in `wildo.website.config.ts`, all or nothing, so the pack stands for the\n * whole scenario. From then on the application owns the pack: translating it is the scenario's own post-note, and a\n * re-applied scenario would find it changed and refuse the whole foundation run. reference-creation-ci's foundation\n * failed every re-run on `website/src/i18n/de.json` and stayed a REFRESH the loop chose again each round.\n *\n * The pack is named by the locale's path segment, derived from the member exactly as the scenario derives\n * `localePath`. A member that names no language has no pack to find; the planner refuses it before this is asked.\n */\n [CompositionScenarioRef.ADD_LOCALE]: (variables) => {\n const member = variables['localeMember'];\n const language = member !== undefined && Object.hasOwn(AvailableLanguage, member) ? (AvailableLanguage as Record<string, string>)[member] : undefined;\n return language === undefined ? null : `website/src/i18n/${languagePathSegment(language)}.json`;\n },\n // No directory of its own: the 3D layout is a dependency and a registration in the existing frontend.\n [CompositionScenarioRef.ADD_3D_LAYOUT]: null,\n};\n\n/**\n * The witness directory of an invocation that is ALREADY composed in this application, or null when it\n * must be applied — the one decision that makes a foundation re-run safe (#1544).\n */\nexport function alreadyComposedWitness(\n invocation: { readonly scenarioRef: CompositionScenarioRef; readonly variables: Readonly<Record<string, string>> },\n applicationRoot: string,\n): string | null {\n const resolveDirectory = COMPOSED_WITNESS_DIRECTORY[invocation.scenarioRef];\n const witnessDirectory = resolveDirectory === null ? null : resolveDirectory(invocation.variables);\n return witnessDirectory !== null && existsSync(join(applicationRoot, witnessDirectory)) ? witnessDirectory : null;\n}\n\n@injectable()\nexport class FoundationExecutorCompanionService {\n private readonly logDebug: (message: string, context?: Record<string, unknown>) => void;\n\n public constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(COMPANION_SERVICE_TYPES.CompanionContext) private readonly companionContext: CompanionContext,\n ) {\n this.logDebug = this.logger.debugByType('FoundationExecutorCompanionService');\n }\n\n public async execute(input: {\n /** The landed domain-plan VALUE (the run service resolves it from artifact state). */\n readonly domainPlan: unknown;\n /**\n * The creator's tenancy answer — the FALLBACK, for a domain plan authored before the plan\n * carried `tenancy` itself. A plan that states it wins, because that is the committed decision.\n */\n readonly elicitationAnswers: ReadonlyArray<{ readonly questionRef: string; readonly answer: string }>;\n /** Compute and report everything, write nothing. */\n readonly dryRun?: boolean;\n /**\n * Told each file as this run writes it (#3237), so a run that fails part-way still names what it wrote: its landing\n * records those, under `landingFailed`, rather than leaving them for another lane's commit. A completed run also\n * reports them all in `writtenPaths`.\n */\n readonly onWrite?: (applicationRelativePath: string) => void;\n /**\n * Told each file a step MAY write, before the step runs (#3237 review M3): a configuration editor, the ownership,\n * access-posture and identity declarations, the brand propagation. The landing marks it in flight; only a file the\n * step then reports writing (`onWrite`) enters the record.\n */\n readonly onMayWrite?: (applicationRelativePath: string) => void;\n }): Promise<FoundationExecutionResult> {\n // It composes from the landed families, and a family read short changes what it composes (#3258). Run again once the module evaluates.\n if (input.dryRun !== true) await assertSpecificationsReadWhole(this.companionContext, 'The foundation');\n const primaryScope = this.resolvePrimaryScope(input.domainPlan, input.elicitationAnswers);\n const applicationRoot = this.companionContext.saasRoot;\n // What this run writes, as each step reports it (#3237). A dry run reports nothing written.\n const written = new Set<string>();\n const toApplicationPath = (filePath: string): string => (isAbsolute(filePath) ? relative(applicationRoot, filePath) : filePath).split(sep).join('/');\n const noteWrite = (filePath: string): void => {\n if (input.dryRun === true) return;\n const applicationRelativePath = toApplicationPath(filePath);\n written.add(applicationRelativePath);\n input.onWrite?.(applicationRelativePath);\n };\n const noteMayWrite = (filePath: string): void => {\n if (input.dryRun !== true) input.onMayWrite?.(toApplicationPath(filePath));\n };\n // What this run composes without rewriting (#3237 review H1): see `stillComposedPaths`.\n const stillComposed = new Set<string>();\n const noteComposed = (filePath: string): void => {\n if (input.dryRun !== true) stillComposed.add(toApplicationPath(filePath));\n };\n const sharedLibPackage = this.readSharedLibPackageName(applicationRoot);\n\n const businessModel = await this.readLandedFamilyValue('business-model');\n const capabilityComposition = await this.readLandedFamilyValue('capability-composition');\n /* What runs beside the backend (#1495) — one scenario per worker and per minion it declares. */\n const integrationPlan = await this.readLandedFamilyValue('integration-plan');\n /* The application's line (#1605) decides whether one organization owns it. */\n const creatorInputs = await this.readLandedFamilyValue('creator-inputs') as ApplicationCreatorInputs | undefined;\n const lineDeclaration = resolveApplicationLineDeclaration(creatorInputs);\n /*\n * Host facts are needed by an optional PACKAGE scenario, and a worker or a minion is one: its\n * package name derives from the application slug. So they are resolved whenever EITHER family\n * has landed, not only for the composition.\n */\n const hostFacts = capabilityComposition === undefined && integrationPlan === undefined ? undefined : await this.resolveHostFacts(applicationRoot);\n const plan = deriveFoundationCompositionPlan({\n domainPlan: input.domainPlan,\n primaryScope,\n sharedLibPackage,\n ...(businessModel === undefined ? {} : { businessModel }),\n ...(capabilityComposition === undefined ? {} : { capabilityComposition }),\n /*\n * The backend-api name is read only when a MINION will need it. An integration plan declaring\n * workers and no minion refused the whole foundation run over an unreadable manifest that\n * nothing was going to use.\n */\n ...(integrationPlan === undefined ? {} : {\n integrationPlan,\n ...(this.declaresAMinion(integrationPlan) ? { backendApiPackage: this.readBackendApiPackageName(applicationRoot) } : {}),\n }),\n ...(hostFacts === undefined ? {} : { hostFacts }),\n elicitationAnswers: input.elicitationAnswers,\n ...(lineDeclaration.state === ApplicationLineDeclarationState.DECLARED ? { applicationLine: lineDeclaration.line } : {}),\n /* A secondary line needing the firm's method makes it a firm serving clients, whatever its line (#2305). */\n ...(creatorInputs === undefined ? {} : { creatorInputs }),\n });\n this.logDebug('Foundation composition plan derived', {\n primaryScope,\n businessModelRead: businessModel !== undefined,\n capabilityCompositionRead: capabilityComposition !== undefined,\n integrationPlanRead: integrationPlan !== undefined,\n capabilityChanges: plan.engineCapabilityChanges.length,\n capabilitiesOwedAProvider: plan.engineCapabilitiesOwedAProvider.length,\n scenarioInvocations: plan.scenarioInvocations.length,\n });\n\n // Capability first: the composed resources' primary-scope posture assumes it.\n // The configuration editors write the application configuration: named before they run (#3237 review M3).\n noteMayWrite(SAAS_CONFIG_FILE_NAME);\n const { engineCapabilityChanges, engineCapabilitiesOwedAProvider } = this.applyEngineCapabilityPlan({\n plan,\n elicitationAnswers: input.elicitationAnswers,\n ...(input.dryRun === true ? { dryRun: true } : {}),\n noteWrite,\n noteComposed,\n });\n\n const frameworkRoot = this.companionContext.resolvedHomes.framework.repositoryRoot ?? null;\n const scenarioDirectoriesByRef = listCompositionScenarioDirectories({ applicationRoot, frameworkRoot });\n const renderer: CompositionTemplateRenderer = createCompositionTemplateRenderer();\n\n const modulesComposedByThisRun = new Set(\n plan.scenarioInvocations\n .filter((invocation) => invocation.scenarioRef === CompositionScenarioRef.ADD_MODULE)\n .map((invocation) => String(invocation.variables['moduleId'])),\n );\n const scenarios: FoundationScenarioExecutionRecord[] = [];\n for (const invocation of plan.scenarioInvocations) {\n // DRY-RUN sequencing honesty: an add-resource edits its module's registry files, which the\n // same run's add-module WRITES. A real run applies sequentially so the files exist by then;\n // a dry run plans against the unmodified tree, where planning the edit would (correctly)\n // refuse on a missing target. Report the dependency instead of failing the whole preview.\n if (\n input.dryRun === true\n && invocation.scenarioRef === CompositionScenarioRef.ADD_RESOURCE\n && modulesComposedByThisRun.has(String(invocation.variables['moduleId']))\n && !existsSync(join(applicationRoot, 'shared-lib', 'src', 'modules', String(invocation.variables['moduleId'])))\n ) {\n scenarios.push({\n scenarioRef: invocation.scenarioRef,\n subject: `${invocation.variables['moduleId']}/${invocation.variables['resourceDir']}`,\n writes: 0, skippedWrites: 0, editsApplied: 0, skippedEdits: 0,\n deferredBehindModuleComposition: true,\n });\n continue;\n }\n const witnessDirectory = alreadyComposedWitness(invocation, applicationRoot);\n if (witnessDirectory !== null) {\n if (input.dryRun !== true) {\n noteComposed(witnessDirectory);\n // Everything the scenario WOULD write or edit, planned as a dry run plans it (#3237 review H1): a module is four\n // trees and five registry, barrel and companion-exports edits, and its witness names only one of the trees.\n for (const target of this.planInvocationTargets({ invocation, applicationRoot, scenarioDirectoriesByRef, renderer })) noteComposed(target);\n }\n scenarios.push({ scenarioRef: invocation.scenarioRef, subject: witnessDirectory, writes: 0, skippedWrites: 0, editsApplied: 0, skippedEdits: 0, alreadyComposed: true });\n continue;\n }\n scenarios.push(this.applyInvocation({ invocation, applicationRoot, scenarioDirectoriesByRef, renderer, dryRun: input.dryRun === true, noteWrite }));\n }\n /*\n * A surface composed NOW receives the mark accepted EARLIER. The logo step propagates when it runs,\n * but once landed it is never dispatched again, so a website or portal composed after it — a\n * conception re-run that newly decides one — would serve no favicon and no Open Graph image. This is\n * the moment that surface appears, so this is where it is supplied. Nothing accepted: nothing written.\n */\n const propagatesBrand = composedASurfaceReceivingTheBrand(scenarios) && input.dryRun !== true;\n if (propagatesBrand) {\n // Named before the propagation writes them (#3237 review M3): what a dry run of the same propagation would write.\n const preview = await propagateBrandAssets({ appRoot: applicationRoot, dryRun: true }).catch(() => undefined);\n for (const destination of preview?.destinations ?? []) for (const wouldWrite of destination.result?.wrote ?? []) noteMayWrite(wouldWrite);\n }\n const brandPropagation = propagatesBrand ? await propagateAcceptedBrand(applicationRoot, this.logger) : undefined;\n /*\n * The ownership, access-posture and identity steps edit the application's declaration files and author the identity\n * declaration; which of them is known only inside each step, so the whole set is named before they run (#3237\n * review M3). Only what a step reports changing enters the record; one it found in place is still composed.\n */\n for (const declarationFile of Object.values(BlueprintDeclarationFile)) noteMayWrite(declarationFile);\n noteMayWrite(ORGANIZATION_IDENTITY_DECLARATION_FILE);\n const applicationOwnership = this.declareApplicationOwnership(\n plan.applicationOwnership,\n applicationRoot,\n input.dryRun === true,\n engineCapabilityChanges.some((change) => change.capability === EngineCapability.ORGANIZATIONS),\n );\n const accessPosture = this.applyAccessPosture({ lineDeclaration, applicationOwnership, applicationRoot, elicitationAnswers: input.elicitationAnswers, domainPlan: input.domainPlan, dryRun: input.dryRun === true });\n const organizationIdentity = this.declareOwnerOrganizationIdentity({ lineDeclaration, accessPosture, applicationRoot, domainPlan: input.domainPlan, dryRun: input.dryRun === true });\n // Both ownership layouts edit the application configuration, and say only whether they changed it.\n if (applicationOwnership.changed === true) noteWrite(SAAS_CONFIG_FILE_NAME);\n else if (applicationOwnership.changed === false) noteComposed(SAAS_CONFIG_FILE_NAME);\n for (const write of accessPosture?.writes ?? []) (write.changed ? noteWrite : noteComposed)(write.file);\n if (organizationIdentity !== undefined && 'declarationFile' in organizationIdentity) {\n (organizationIdentity.declarationFile.changed ? noteWrite : noteComposed)(organizationIdentity.declarationFile.path);\n (organizationIdentity.wiring.changed ? noteWrite : noteComposed)(organizationIdentity.wiring.path);\n }\n for (const destination of brandPropagation?.propagation?.destinations ?? []) for (const wrote of destination.result?.wrote ?? []) noteWrite(wrote);\n /*\n * The data residency LAST among the configuration edits (#2294): it places the providers every earlier step declared\n * (a capability's provider, a composed minion's scope), and a provider declared after it would be one it never saw.\n */\n // The operator's identity and jurisdictions first: the residency writes into the same identity object after them.\n const operatorDeclarations = await this.declareOperatorDeclarations({ applicationRoot, elicitationAnswers: input.elicitationAnswers, dryRun: input.dryRun === true });\n if (operatorDeclarations.changed) noteWrite(SAAS_CONFIG_FILE_NAME);\n else if (operatorDeclarations.composed) noteComposed(SAAS_CONFIG_FILE_NAME);\n const dataResidency = await this.declareDataResidency({ applicationRoot, elicitationAnswers: input.elicitationAnswers, dryRun: input.dryRun === true });\n if (dataResidency.changed) noteWrite(SAAS_CONFIG_FILE_NAME);\n else if (dataResidency.writes.length > 0) noteComposed(SAAS_CONFIG_FILE_NAME);\n const dependencyInstall = input.dryRun === true ? undefined : await this.installDependenciesIfManifestsChanged(applicationRoot, written, noteWrite);\n return {\n playbookRef: 'bottom_up.foundation',\n primaryScope,\n engineCapabilityChanges,\n engineCapabilitiesOwedAProvider,\n scenarios,\n applicationOwnership,\n engineCapabilitiesContradictingLine: this.findEngineCapabilitiesContradictingLine(applicationRoot, lineDeclaration),\n ...(accessPosture === undefined ? {} : { accessPosture }),\n ...(organizationIdentity === undefined ? {} : { organizationIdentity }),\n systemsOfRecord: await this.declareSystemsOfRecord(input.domainPlan, applicationRoot),\n compositionScenarios: plan.compositionScenarios,\n backgroundExecution: plan.backgroundExecution,\n ...(hostFacts === undefined ? {} : { hostFacts }),\n ...(brandPropagation === undefined ? {} : { brandPropagation }),\n writtenPaths: [...written].sort(),\n stillComposedPaths: [...stillComposed].sort(),\n ...(dependencyInstall === undefined ? {} : { dependencyInstall }),\n dataResidency: dataResidency.outcome,\n operatorDeclarations: operatorDeclarations.outcome,\n };\n }\n\n /**\n * Write the operator's identity parts and operating jurisdictions the interview answered (#2294 follow-up), through\n * `planFoundationOperatorDeclarations` over the configuration as it stands now: additive only, an authored value kept,\n * an unanswered question an advisory. Never thrown: a configuration it cannot read (or an authored shape the writer\n * refuses to edit) is reported with nothing written, and the foundation lands.\n */\n private async declareOperatorDeclarations(input: {\n readonly applicationRoot: string;\n readonly elicitationAnswers: ReadonlyArray<{ readonly questionRef: string; readonly answer: string }>;\n readonly dryRun: boolean;\n }): Promise<{ readonly outcome: FoundationOperatorDeclarationsOutcome | { readonly advisory: string }; readonly changed: boolean; readonly composed: boolean }> {\n const answerTo = (questionRef: string): string | undefined => input.elicitationAnswers.find((candidate) => candidate.questionRef === questionRef)?.answer;\n try {\n const saasConfig = await this.loadApplicationConfigFresh(input.applicationRoot);\n const plan = planFoundationOperatorDeclarations({\n entityAnswer: answerTo(OPERATING_ENTITY_QUESTION_REF),\n jurisdictionsAnswer: answerTo(OPERATING_JURISDICTIONS_QUESTION_REF),\n declaredIdentity: saasConfig.operatorComplianceIdentity,\n declaredJurisdictions: saasConfig.operatingJurisdictions,\n });\n const { changed, ...outcome } = applyFoundationOperatorDeclarations({ applicationRoot: input.applicationRoot, plan, dryRun: input.dryRun });\n this.logDebug('Foundation operator declarations', { identity: plan.identity.state, jurisdictions: plan.operatingJurisdictions.state, changed });\n return { outcome, changed: changed && !input.dryRun, composed: outcome.writes.length > 0 };\n } catch (error) {\n const advisory = `The operator's identity and operating jurisdictions could not be written, and nothing was written for them: ${describeCaughtError(error)}`;\n this.logDebug(advisory);\n return { outcome: { advisory }, changed: false, composed: false };\n }\n }\n\n /**\n * Write the data residency the interview answered, after placing the providers that serve the application's data\n * (#2294). The decision is `planFoundationDataResidency`, over the configuration as it stands NOW (re-loaded, since\n * this run edited it) and the providers' compliance profiles through the application's own discovery, the population\n * and profiles `wildo config sync` refuses on. Never thrown: a configuration or a discovery it cannot read is reported\n * NOT_EVALUATED with nothing written, so the foundation lands and the residency stays visibly open.\n */\n private async declareDataResidency(input: {\n readonly applicationRoot: string;\n readonly elicitationAnswers: ReadonlyArray<{ readonly questionRef: string; readonly answer: string }>;\n readonly dryRun: boolean;\n }): Promise<{ readonly outcome: FoundationDataResidencyOutcome; readonly changed: boolean; readonly writes: FoundationDataResidencyOutcome['writes'] }> {\n const answer = input.elicitationAnswers.find((candidate) => candidate.questionRef === DATA_RESIDENCY_TERRITORIES_QUESTION_REF)?.answer;\n try {\n const saasConfig = await this.loadApplicationConfigFresh(input.applicationRoot);\n const providerRefs = dataServingProviderRefs(saasConfig.providers.scopes);\n // Profiles are read only when places were answered: nothing else consults them, and discovery loads every provider package.\n const placesAnswered = answer !== undefined && parseJurisdictionSlugList(answer).kind === JurisdictionSlugListReadingKind.SLUGS;\n const discovery = placesAnswered ? await this.resolveProviderComplianceProfiles(input.applicationRoot, saasConfig) : undefined;\n const plan = planFoundationDataResidency({\n answer,\n declared: saasConfig.operatorComplianceIdentity?.dataResidency,\n choices: saasConfig.providerComplianceChoices,\n profilesByProviderRef: discovery?.profilesByProviderRef ?? {},\n providerRefs,\n });\n const applied = applyFoundationDataResidency({ applicationRoot: input.applicationRoot, plan, dryRun: input.dryRun });\n const { filePath: _filePath, changed, ...outcome } = applied;\n const unreadable = discovery?.unreadableOwners ?? [];\n const withUnreadable: FoundationDataResidencyOutcome = unreadable.length === 0 || plan.state !== FoundationDataResidencyState.PROVIDERS_UNPLACED\n ? outcome\n : { ...outcome, advisory: `${outcome.advisory ?? ''} Provider discovery could not read ${unreadable.length} owner(s), so a provider reported without a profile may have one there.`.trim() };\n this.logDebug('Foundation data residency', { state: plan.state, derived: plan.derivedChoices.length, unplaced: plan.unplacedProviders.length, changed });\n return { outcome: withUnreadable, changed: changed && !input.dryRun, writes: outcome.writes };\n } catch (error) {\n const outcome: FoundationDataResidencyOutcome = {\n state: FoundationDataResidencyState.NOT_EVALUATED,\n derivedChoices: [],\n unplacedProviders: [],\n writes: [],\n advisory: `The data residency could not be evaluated, and nothing was written for it: ${describeCaughtError(error)}`,\n };\n this.logDebug('The foundation could not evaluate the data residency; nothing was written for it', { error: describeCaughtError(error) });\n return { outcome, changed: false, writes: [] };\n }\n }\n\n /** `wildo.saas.config.ts` as it stands now, past this run's own edits (never the boot-time config). */\n private async loadApplicationConfigFresh(applicationRoot: string): Promise<WildoSaasConfig> {\n const config = await loadSaasConfig(join(applicationRoot, SAAS_CONFIG_FILE_NAME), { freshModuleCache: true });\n if (config === null) throw new Error(`${join(applicationRoot, SAAS_CONFIG_FILE_NAME)} could not be loaded`);\n return config;\n }\n\n /** The providers' compliance profiles through the application's own discovery, as `wildo config sync` reads them. */\n private async resolveProviderComplianceProfiles(applicationRoot: string, saasConfig: WildoSaasConfig): ReturnType<typeof resolveProviderComplianceProfiles> {\n return resolveProviderComplianceProfiles({ saasRoot: applicationRoot, saasConfig });\n }\n\n /**\n * Install the application's dependencies when this run changed what they are (#3204).\n *\n * A composed scenario that adds a workspace package (`add-minion`, `add-technical-doc`, `add-website`, …) or edits a\n * manifest (overrides (pnpm-workspace.yaml), a dependency) leaves the lockfile describing the application BEFORE it. Each scenario's\n * post-note tells a person to run `pnpm install`; an unattended creation has no person, so the run that changed the\n * manifests runs it. Measured on reference run 42468505853: the foundation added a technical-documentation site and\n * three minions, nothing installed them, and every later restart of the development stack retried a frozen reinjection\n * that refused the stale lockfile (`ERR_PNPM_LOCKFILE_CONFIG_MISMATCH`), while the new packages had no dependencies to\n * compile against.\n *\n * `--no-frozen-lockfile` is deliberate: the lockfile must follow the manifests this run changed, and pnpm freezes it by\n * default when `CI` is set. The lockfile is recorded as one of this run's writes, so it lands in the same commit as the\n * manifests it describes. Never thrown: the composition stands, and a failed install is reported for a person to repeat.\n */\n private async installDependenciesIfManifestsChanged(\n applicationRoot: string,\n written: ReadonlySet<string>,\n noteWrite: (filePath: string) => void,\n ): Promise<FoundationDependencyInstall | undefined> {\n const manifests = [...written].filter((path) => basename(path) === 'package.json' || path === 'pnpm-workspace.yaml').sort();\n if (manifests.length === 0) return undefined;\n const startedAt = Date.now();\n /*\n * The links those manifests need first, as `wildo compose` writes them: a composed minion declares\n * `@wildo-ai/wildo-dev-runtime`, an opt-in framework package linked only where declared, and without its override\n * pnpm asks the public registry for it (404, reference run 42486534966). It never REMOVES an override; it may REWRITE\n * one whose value differs from the link it owes (a hand-set version of a linked package), as `wildo compose` does, and\n * the root manifest then enters this run's commit. In app-creator mode (no checkout) the records come from the\n * engine-peer closure delivered with the templates (#3492), and an opt-in package pins to the application's framework\n * release.\n */\n try {\n const frameworkPath = this.companionContext.resolvedHomes?.framework?.repositoryRoot ?? null;\n // Without a checkout the application lives in, the opt-in records delivered with the templates (#3492); with one,\n // the checkout's own. A known framework root the application is outside of is no checkout (#3903).\n const deliveredOptIn = linkableFrameworkCheckout(applicationRoot, frameworkPath) === null\n ? readDeliveredOptInFrameworkPackages(applicationRoot)\n : undefined;\n const links = ProviderPackageLinksService.reconcileAndReport({\n applicationRoot,\n frameworkPath,\n log: { info: (message) => this.logDebug(message), warn: (message) => this.logger.warn(message) },\n write: true,\n ...(deliveredOptIn === undefined ? {} : { optInFrameworkPackages: deliveredOptIn }),\n });\n if (links.added.length > 0) noteWrite('package.json');\n } catch (error) {\n const install = { succeeded: false, manifests, durationMs: Date.now() - startedAt, error: `The framework package links could not be written: ${describeCaughtError(error)}` } as const;\n this.logger.warn('The foundation could not link the framework packages its composition declared; run `wildo compose` or link them, then `pnpm install`', install);\n return install;\n }\n const lockfilePath = join(applicationRoot, 'pnpm-lock.yaml');\n const lockfileBefore = existsSync(lockfilePath) ? readFileSync(lockfilePath, 'utf8') : undefined;\n try {\n /*\n * The install is a STACK EVENT (#3552): it re-creates `node_modules` while `wildo local dev` runs against it. The\n * record tells every supervisor to hold its runtime and spend no crash budget until it ends, then to relaunch (after\n * repairing the injected snapshots), and every compile watcher that read the tree before it ended to compile again.\n * Without it, reference run 42666728304 left three packages FAILED on a missing `typescript/lib`, the backend paused\n * and the companion's own creation reads answering 500.\n */\n await withDependencyInstallRecord(\n applicationRoot,\n {\n initiator: 'foundation',\n timeoutMs: FOUNDATION_DEPENDENCY_INSTALL_TIMEOUT_MS,\n reportFailure: (message, error) => this.logger.warn(message, { error: describeCaughtError(error) }),\n },\n () => promisify(execFile)('pnpm', ['install', '--prefer-offline', '--no-frozen-lockfile'], {\n cwd: applicationRoot,\n timeout: FOUNDATION_DEPENDENCY_INSTALL_TIMEOUT_MS,\n maxBuffer: 16 * 1024 * 1024,\n }),\n );\n const lockfileAfter = existsSync(lockfilePath) ? readFileSync(lockfilePath, 'utf8') : undefined;\n if (lockfileAfter !== lockfileBefore) noteWrite('pnpm-lock.yaml');\n const install = { succeeded: true, manifests, durationMs: Date.now() - startedAt } as const;\n this.logger.info('The foundation installed the dependencies its composition changed', install);\n return install;\n } catch (error) {\n // pnpm reports a failure on STDOUT (`ERR_PNPM_…`), so both streams are kept, stdout's tail first.\n const caught = error as { readonly stdout?: string; readonly stderr?: string; readonly message?: string };\n const detail = [caught.stdout?.trim(), caught.stderr?.trim()].filter(Boolean).join('\\n') || caught.message || String(error);\n const tail = detail.slice(-2000);\n const install = { succeeded: false, manifests, durationMs: Date.now() - startedAt, error: tail } as const;\n this.logger.warn('The foundation could not install the dependencies its composition changed; run `pnpm install` at the application root', install);\n return install;\n }\n }\n\n /**\n * Turn on what a capability plan says this application needs (#1272, #1488), and report what stays owed.\n *\n * Shared by the foundation run and by the build lane's `engine-capabilities` step (#2497), so the two cannot\n * disagree about how a need becomes configuration: a provider-free capability is enabled; a capability the\n * engine refuses to boot without a provider is served by the creator's chosen provider, else by a\n * credential-free engine provider, else reported owed.\n */\n private applyEngineCapabilityPlan(input: {\n readonly plan: Pick<FoundationCompositionPlan, 'engineCapabilityChanges' | 'engineCapabilitiesOwedAProvider'>;\n readonly elicitationAnswers: ReadonlyArray<{ readonly questionRef: string; readonly answer: string }>;\n readonly dryRun?: boolean;\n /** Told each file a configuration edit changed (#3237): the foundation's write record is computed from them. */\n readonly noteWrite?: (filePath: string) => void;\n /** Told each file a configuration edit found already in place: still composed by this run (#3237 review H1). */\n readonly noteComposed?: (filePath: string) => void;\n }): Pick<FoundationExecutionResult, 'engineCapabilityChanges' | 'engineCapabilitiesOwedAProvider'> {\n const applicationRoot = this.companionContext.saasRoot;\n const noted = <T extends { readonly changed: boolean; readonly filePath: string }>(result: T): T => {\n if (result.changed) input.noteWrite?.(result.filePath);\n else input.noteComposed?.(result.filePath);\n return result;\n };\n const engineCapabilityChanges: FoundationExecutionResult['engineCapabilityChanges'][number][] = input.plan.engineCapabilityChanges.map((change) => {\n const result = noted(setEngineCapabilityEnabled({\n applicationRoot,\n capability: change.capability,\n enabled: true,\n ...(input.dryRun === true ? { dryRun: true } : {}),\n }));\n return { capability: change.capability, basis: change.basis, changed: result.changed, summary: result.summary };\n });\n /*\n * An owed capability is SERVED here when a credential-free engine provider exists for it (#1272)\n * — declared, selected and enabled in one pass — and stays owed otherwise. Three mutations,\n * because two of them are not optional: the boot floor needs a provider in the scope, and a\n * SELECT_ONE capability needs `selection[<capability>].primary` beside it. The capability is\n * enabled LAST, so a failure part-way leaves the application not-yet-configured rather than\n * enabled-and-unbootable.\n */\n const engineCapabilitiesOwedAProvider: FoundationExecutionResult['engineCapabilitiesOwedAProvider'][number][] = [];\n for (const owed of input.plan.engineCapabilitiesOwedAProvider) {\n /*\n * The creator's own choice comes FIRST (#1488): an answered provider question is a decision, and a\n * credential-free substitute must never override one. A `refused` resolution cannot occur through a\n * run (the interview validator refuses first) and is handled anyway — reported on the owed entry with\n * the offered set — so a direct caller of the executor gets the same honest answer as a run.\n */\n const selected = resolveCreatorSelectedEngineProvider(owed.capability, input.elicitationAnswers);\n if (selected?.kind === 'refused') {\n engineCapabilitiesOwedAProvider.push({ capability: owed.capability, basis: owed.basis, remedy: `${selected.reason} Answer the question again with one of them.` });\n continue;\n }\n if (selected?.kind === 'selected') {\n const writeOptions = input.dryRun === true ? { dryRun: true as const } : {};\n noted(addProviderToScope({\n applicationRoot,\n scope: { kind: 'backend' },\n providerRef: selected.providerRef,\n engineCapabilities: [owed.capability],\n providerCapabilities: selected.providerCapabilities,\n protocols: selected.protocols,\n ...writeOptions,\n }));\n if (engineCapabilityResolutionModeTakesASelection(getEngineCapabilityResolutionMode(owed.capability))) {\n noted(setProviderSelectionPrimary({\n applicationRoot,\n scope: { kind: 'backend' },\n capability: owed.capability,\n primaryProviderRef: selected.providerRef,\n ...writeOptions,\n }));\n }\n const enabled = noted(setEngineCapabilityEnabled({ applicationRoot, capability: owed.capability, enabled: true, ...writeOptions }));\n engineCapabilityChanges.push({\n capability: owed.capability,\n basis: owed.basis,\n changed: enabled.changed,\n summary: enabled.summary,\n servedByCreatorSelectedProvider: {\n providerRef: selected.providerRef,\n credentialsOwed: selected.credentialsOwed,\n remedy: selected.credentialsOwed.length === 0\n ? `\\`${selected.providerRef}\\` needs no credentials; ${owed.capability} is enabled and serving.`\n : `\\`${selected.providerRef}\\` is declared, selected and ${owed.capability} is enabled — the application boots, and `\n + `${owed.capability} answers once these are set in the environment: ${selected.credentialsOwed.map((secret) => secret.envVarName).join(', ')}.`,\n },\n });\n continue;\n }\n const provider = resolveCredentialFreeEngineProvider(owed.capability);\n if (!provider) {\n engineCapabilitiesOwedAProvider.push({\n capability: owed.capability,\n basis: owed.basis,\n remedy: `This application's own declarations imply ${owed.capability} (${owed.basis}), and it is NOT enabled: `\n + 'the engine refuses to boot with it on and no provider resolving, and every provider that serves it '\n + 'needs an account this process cannot open. Declare one that serves '\n + `${owed.capability} in \\`wildo.saas.config.ts\\` under \\`providers.scopes\\`, then enable the capability beside it.`,\n });\n continue;\n }\n const writeOptions = input.dryRun === true ? { dryRun: true as const } : {};\n noted(addProviderToScope({\n applicationRoot,\n scope: { kind: 'backend' },\n providerRef: provider.providerRef,\n engineCapabilities: [owed.capability],\n providerCapabilities: provider.providerCapabilities,\n protocols: provider.protocols,\n ...writeOptions,\n }));\n // Only a SELECT_ONE capability carries a `selection` entry: FAN_OUT takes every declared provider and\n // BOUND_PER_PURPOSE is bound per key purpose (#2891), so writing one would put the provider into a mechanism\n // nothing consults.\n if (engineCapabilityResolutionModeTakesASelection(getEngineCapabilityResolutionMode(owed.capability))) {\n noted(setProviderSelectionPrimary({\n applicationRoot,\n scope: { kind: 'backend' },\n capability: owed.capability,\n primaryProviderRef: provider.providerRef,\n ...writeOptions,\n }));\n }\n const enabled = noted(setEngineCapabilityEnabled({\n applicationRoot,\n capability: owed.capability,\n enabled: true,\n ...writeOptions,\n }));\n engineCapabilityChanges.push({\n capability: owed.capability,\n basis: owed.basis,\n changed: enabled.changed,\n summary: enabled.summary,\n servedByDeclaredProvider: {\n providerRef: provider.providerRef,\n developmentSubstitute: true,\n replaceBeforeRealUsers: `\\`${provider.providerRef}\\` needs no account, which is why this run could declare it — `\n + 'and it is a DEVELOPMENT substitute. Replace it with a provider that really serves '\n + `${owed.capability} before this application faces real users.`,\n },\n });\n }\n return { engineCapabilityChanges, engineCapabilitiesOwedAProvider };\n }\n\n /**\n * The engine capabilities the application's LANDED decisions imply and this companion can turn on without a\n * person (#2497), whether or not they are on already: every provider-free need, and every need a\n * credential-free engine provider can serve. A need that only a commercial provider can serve (BILLING, SMS)\n * is left out, because no step of ours can satisfy it and a step that can never land would hold the build.\n *\n * Read from the landed domain plan's `tenancy`, the business model and the integration plan, the same\n * inputs the foundation reads. `undefined` when no domain plan with a tenancy has landed: there is nothing\n * to derive from, which is a different answer from \"nothing is needed\". Throws when one of those inputs could not be\n * read: an unknown input must not shrink the plan.\n */\n public async deriveSatisfiableEngineCapabilityPlan(): Promise<SatisfiableEngineCapabilityPlan | undefined> {\n const landedDomainPlan = await this.readLandedFamilyValue('domain-plan');\n const domainPlan = DomainPlanOutputSetSchema.safeParse(landedDomainPlan);\n // A plan that landed and does not parse is not one that never landed: what it decides is unknown (#3258).\n if (!domainPlan.success && landedDomainPlan !== undefined) throw new Error(`The landed domain plan does not satisfy its schema: ${domainPlan.error.issues[0]?.message}`);\n if (!domainPlan.success || domainPlan.data.tenancy === undefined) return undefined;\n const businessModel = await this.readLandedFamilyValue('business-model');\n const integrationPlan = await this.readLandedFamilyValue('integration-plan');\n // The line excludes some capabilities whatever implies them (#1605), on this lane exactly as in the foundation.\n const lineDeclaration = resolveApplicationLineDeclaration(await this.readLandedFamilyValue('creator-inputs') as ApplicationCreatorInputs | undefined);\n const derived = deriveEngineCapabilityPlan({\n primaryScope: domainPlan.data.tenancy,\n businessModel,\n ...(integrationPlan === undefined ? {} : { integrationPlan }),\n // The build lane has no foundation interview, so no creator provider choice: only credential-free service.\n elicitationAnswers: [],\n ...(lineDeclaration.state === ApplicationLineDeclarationState.DECLARED ? { applicationLine: lineDeclaration.line } : {}),\n });\n const plan = {\n engineCapabilityChanges: derived.engineCapabilityChanges,\n engineCapabilitiesOwedAProvider: derived.engineCapabilitiesOwedAProvider\n .filter((owed) => resolveCredentialFreeEngineProvider(owed.capability) !== undefined),\n };\n return { plan, capabilities: [...plan.engineCapabilityChanges, ...plan.engineCapabilitiesOwedAProvider].map((need) => need.capability) };\n }\n\n /**\n * The build lane's `engine-capabilities` step (#2497): enable every satisfiable capability the decisions imply\n * that the application's configuration does not already enable.\n *\n * A capability already on is left exactly as it is, provider included: re-declaring `email-preview` over a\n * provider the creator chose afterwards would undo a decision. So this only ever ADDS what is missing.\n *\n * \"Missing\" includes an explicit `enabled: false`, and that is deliberate: the scaffold itself writes\n * `ORGANIZATIONS: { enabled: false }`, so `false` cannot be read as a creator's decision. The consequence is\n * that a creator who turns off a capability the decisions imply sees it turned back on at the next build;\n * the remedy is the decision itself (the domain plan's tenancy, the integration plan's channels). The same\n * holds for a capability declared with a provider but disabled: enabling it here also declares and, for a\n * SELECT_ONE capability, selects the credential-free provider beside the one already declared.\n */\n public async alignEngineCapabilitiesWithDecisions(input: { readonly dryRun?: boolean } = {}): Promise<EngineCapabilityAlignmentResult> {\n const satisfiable = await this.deriveSatisfiableEngineCapabilityPlan();\n if (satisfiable === undefined) return { derived: false, capabilities: [], engineCapabilityChanges: [], engineCapabilitiesOwedAProvider: [] };\n const filePath = join(this.companionContext.saasRoot, SAAS_CONFIG_FILE_NAME);\n const content = readFileSync(filePath, 'utf8');\n const missing = (need: { readonly capability: EngineCapability }) => readEngineCapabilityEnabled({ filePath, content, capability: need.capability }) !== true;\n const applied = this.applyEngineCapabilityPlan({\n plan: {\n engineCapabilityChanges: satisfiable.plan.engineCapabilityChanges.filter(missing),\n engineCapabilitiesOwedAProvider: satisfiable.plan.engineCapabilitiesOwedAProvider.filter(missing),\n },\n elicitationAnswers: [],\n ...(input.dryRun === true ? { dryRun: true } : {}),\n });\n return { derived: true, capabilities: satisfiable.capabilities, ...applied };\n }\n\n /**\n * The host facts an optional-package scenario needs and no family declares (#1491): the slug and display\n * name from the SaaS config, the port block from the declared services, and the public domain from the\n * application's own infrastructure environments — a REMOTE one first (production, then staging), because\n * that is the apex the website and the portal derive their canonical origins from, and the local one\n * otherwise. `localhost` when no environment declares one, which is the value the framework's own local\n * example uses; the source is recorded on the result so a reader can see which it was.\n */\n private async resolveHostFacts(applicationRoot: string): Promise<FoundationHostFacts & { readonly publicDomainSource: string }> {\n const services = Object.values(this.companionContext.servicesByKey);\n const backendPort = services.find((service) => service.frontendType === undefined)?.defaultPort;\n const appPort = services.find((service) => service.frontendType === AppFrontendType.SAAS_APP)?.defaultPort;\n if (backendPort === undefined || appPort === undefined) {\n throw new FoundationExecutionError(\n 'The optional-package scenarios derive their ports from the backend and app services\\' `defaultPort`, and `wildo.saas.config.ts` declares no such port for '\n + (backendPort === undefined ? 'the backend service' : 'the app service') + '.',\n );\n }\n let publicDomain = 'localhost';\n let publicDomainSource = 'default (no environment declares a public domain)';\n for (const envName of ['production', 'staging', 'local']) {\n try {\n const loaded = await loadInfraEnvConfig(applicationRoot, envName, { freshModuleCache: true });\n const declared = (loaded?.config as { publicDomain?: unknown } | undefined)?.publicDomain;\n if (typeof declared === 'string' && declared.trim().length > 0) {\n publicDomain = declared.trim();\n publicDomainSource = `infrastructure/${envName}`;\n break;\n }\n } catch (error) {\n this.logDebug(`Could not read infrastructure/${envName}; not a source for the public domain`, { error: describeCaughtError(error) });\n }\n }\n return {\n slug: this.companionContext.saasConfig.slug,\n displayName: this.companionContext.saasConfig.displayName,\n publicDomain,\n backendPort,\n appPort,\n publicDomainSource,\n };\n }\n\n /**\n * Lay down the access posture of the application's line (#3037), after its owner is declared, through the one\n * function the line's blueprint also uses (`applyLineAccessPosture`). Only for a single owner: there the owner's user\n * types are every user type. An application arranged as an operator serving clients shares its user type with clients\n * who sign up on their own, so closing registration there would close theirs; nothing is written, and nothing is owed.\n *\n * The corporate identity is the company's answer to `corporate-identity`. An answer that is not one of its values\n * cannot reach here (the interview validator refuses it) and is treated as unanswered.\n */\n private applyAccessPosture(input: {\n readonly lineDeclaration: ReturnType<typeof resolveApplicationLineDeclaration>;\n readonly applicationOwnership: NonNullable<FoundationExecutionResult['applicationOwnership']>;\n readonly applicationRoot: string;\n readonly elicitationAnswers: ReadonlyArray<{ readonly questionRef: string; readonly answer: string }>;\n /** The landed domain plan, which may state the corporate identity through its owner type's joining. */\n readonly domainPlan?: unknown;\n readonly dryRun: boolean;\n }): LineAccessPostureOutcome | undefined {\n if (input.lineDeclaration.state !== ApplicationLineDeclarationState.DECLARED) return undefined;\n if (input.applicationOwnership.structure !== ApplicationOrganizationStructure.SINGLE_OWNER) return undefined;\n const answer = input.elicitationAnswers.find((candidate) => candidate.questionRef === CORPORATE_IDENTITY_QUESTION.questionRef)?.answer;\n // The company's answer, else what the domain plan states (its owner type joining from the directory, #3035).\n const { corporateIdentity, disagreement } = resolveCorporateIdentity({ answer, domainPlan: input.domainPlan });\n try {\n /*\n * The plan may name the owner and its people otherwise (`group` / `employee` against the scaffold's `workspace` /\n * `member`). The foundation renames them first, through declared renames (`renamedFrom`), which move the owner\n * organization and the first administrator the platform already created at the backend's next start (#3044); the\n * posture is then laid down under the new names. A rename it cannot make writes nothing and is owed.\n */\n const rename = input.domainPlan === undefined\n ? undefined\n : renameOwnerToDomainPlanNames({\n applicationRoot: input.applicationRoot,\n domainPlan: input.domainPlan,\n ...(input.applicationOwnership.organizationTypeRef === undefined ? {} : { ownerOrganizationTypeRef: input.applicationOwnership.organizationTypeRef }),\n ...(input.dryRun ? { dryRun: true } : {}),\n });\n const ownerOrganizationTypeRef = rename?.ownerOrganizationTypeRef ?? input.applicationOwnership.organizationTypeRef;\n const posture = applyLineAccessPosture({\n applicationRoot: input.applicationRoot,\n line: input.lineDeclaration.line,\n ...(corporateIdentity === undefined ? {} : { corporateIdentity }),\n // A dry run declares the owner without writing it, so it is handed over rather than re-read.\n ...(ownerOrganizationTypeRef === undefined ? {} : { ownerOrganizationTypeRef }),\n ...(input.dryRun ? { dryRun: true } : {}),\n });\n const outcome: LineAccessPostureOutcome = rename === undefined || (rename.organizationTypeRename === undefined && rename.userTypeRename === undefined && rename.owed.length === 0)\n ? posture\n : {\n ...posture,\n ownerRename: {\n ...(rename.organizationTypeRename === undefined ? {} : { organizationTypeRename: rename.organizationTypeRename }),\n ...(rename.userTypeRename === undefined ? {} : { userTypeRename: rename.userTypeRename }),\n },\n writes: [...rename.writes, ...posture.writes],\n owed: [...rename.owed, ...(rename.afterFirstBoot === undefined ? [] : [rename.afterFirstBoot]), ...posture.owed],\n };\n // What the rename could not give the plan's names stays reported, with the declared rename as its remedy.\n const naming = outcome.ownerOrganizationTypeRef === undefined || outcome.ownerUserTypes === undefined\n ? undefined\n : describeOwnerNamingDifference({ domainPlan: input.domainPlan, ownerOrganizationTypeRef: outcome.ownerOrganizationTypeRef, ownerUserTypes: outcome.ownerUserTypes });\n const reported = [disagreement, naming].filter((entry): entry is string => entry !== undefined);\n return reported.length === 0 ? outcome : { ...outcome, owed: [...outcome.owed, ...reported] };\n } catch (error) {\n return {\n registrationMode: resolveLineAccessPosture(input.lineDeclaration.line).ownerUserRegistrationMode,\n writes: [],\n owed: [`The ${input.lineDeclaration.line} line's sign-up and sign-in posture could not be laid down: ${describeCaughtError(error)}`],\n };\n }\n }\n\n /**\n * Author the owner organization's identity declaration and wire it into startup (#3043), through the creation\n * runtime's `composeOwnerOrganizationIdentityDeclaration`. Only where the line asks for the corporate identity (the\n * internal tool: one company's people are the users) and the access posture found the organization type that owns the\n * application, since startup refuses an `APPLICATION_OWNER` declaration with no such type. The answer is the one the\n * access posture applied (the company's answer, else what the domain plan states); with none, nothing is written and\n * the answer is owed. A failure is reported owed, never thrown: authoring work, so it is marked, never gated.\n */\n private declareOwnerOrganizationIdentity(input: {\n readonly lineDeclaration: ReturnType<typeof resolveApplicationLineDeclaration>;\n readonly accessPosture: LineAccessPostureOutcome | undefined;\n readonly applicationRoot: string;\n readonly domainPlan?: unknown;\n readonly dryRun: boolean;\n }): FoundationExecutionResult['organizationIdentity'] {\n if (input.lineDeclaration.state !== ApplicationLineDeclarationState.DECLARED) return undefined;\n if (!resolveLineAccessPosture(input.lineDeclaration.line).asksCorporateIdentity) return undefined;\n if (input.accessPosture?.ownerOrganizationTypeRef === undefined) return undefined;\n const corporateIdentity = input.accessPosture.corporateIdentity;\n if (corporateIdentity === undefined) {\n return { owed: [`The organization identity declaration (\\`backend-api/src/organization-identity.ts\\`) was not written: \\`${CORPORATE_IDENTITY_QUESTION.questionRef}\\` is unanswered, and its single sign-on posture follows from the answer. Answer it, and run the foundation again.`] };\n }\n try {\n return composeOwnerOrganizationIdentityDeclaration({\n applicationRoot: input.applicationRoot,\n corporateIdentity,\n ...(input.domainPlan === undefined ? {} : { domainPlan: input.domainPlan }),\n ...(input.dryRun ? { dryRun: true } : {}),\n });\n } catch (error) {\n return { owed: [`The organization identity declaration could not be written: ${describeCaughtError(error)}`] };\n }\n }\n\n /**\n * The systems of record the domain plan puts records in (#3039, foundation half), with the credentials each instance\n * will owe. The instance is the build's binding task's to declare, and the library follows it (see\n * `foundation-systems-of-record` in the creation runtime for why the foundation does not declare it).\n */\n private async declareSystemsOfRecord(domainPlan: unknown, applicationRoot: string): Promise<FoundationExecutionResult['systemsOfRecord']> {\n const needs = deriveSystemOfRecordNeeds(domainPlan);\n if (needs.length === 0) return [];\n const libraryDeclared = backendDeclaresSystemsOfRecordLibrary(applicationRoot);\n const facets = await this.loadSystemOfRecordFacets(applicationRoot);\n return needs.map((need) => ({ ...need, libraryDeclared, ...describeSystemOfRecordCredentialsOwed(need, facets) }));\n }\n\n /**\n * The application's EFFECTIVE facets keyed by vendor, a facet the engine's resolution refused carrying why, through the\n * one loader the domain-plan run and the build lane's landing check also read (`loadEffectiveSystemOfRecordFacets`,\n * #3052): the engine's own resolver over the recorded facet modules, so a credential kind a facet augmentation an\n * instance opted into offers is counted as the backend counts it (#3053). `undefined` when no facet module can be read:\n * the credentials are then reported owed with that reason, never guessed.\n */\n private async loadSystemOfRecordFacets(applicationRoot: string): Promise<Readonly<Record<string, SystemOfRecordVendorFacet | { readonly refused: string }>> | undefined> {\n const effective = await loadEffectiveSystemOfRecordFacets({\n applicationRoot,\n frameworkRoot: this.companionContext.resolvedHomes.framework.repositoryRoot ?? undefined,\n // Re-read, not the configuration the companion loaded at start: an instance declared since then counts.\n systemsOfRecord: await rereadDeclaredSystemOfRecordInstances(\n applicationRoot,\n (this.companionContext.saasConfig as { systemsOfRecord?: Record<string, SystemOfRecordInstanceFacetRequest | undefined> } | undefined)?.systemsOfRecord,\n (error) => this.logDebug('wildo.saas.config.ts could not be re-read; judging the systems of record the companion started with', { error: describeCaughtError(error) }),\n ),\n onUnreadable: (specifier, error) => this.logDebug('A system-of-record facet module could not be imported', { specifier, error: describeCaughtError(error) }),\n });\n if (effective === undefined) return undefined;\n return Object.fromEntries(Object.entries(effective.byVendor).map(([vendor, resolved]) => [vendor, 'refused' in resolved ? resolved : resolved.facet]));\n }\n\n /** The excluded capabilities the configuration enables anyway, each with the edit that settles it. */\n private findEngineCapabilitiesContradictingLine(\n applicationRoot: string,\n lineDeclaration: ReturnType<typeof resolveApplicationLineDeclaration>,\n ): FoundationExecutionResult['engineCapabilitiesContradictingLine'] {\n if (lineDeclaration.state !== ApplicationLineDeclarationState.DECLARED) return [];\n // Read off the line definition itself, the one source of what a line never has.\n const excluded = APPLICATION_LINE_DEFINITIONS[lineDeclaration.line].excludedEngineCapabilities;\n if (excluded.length === 0) return [];\n const filePath = join(applicationRoot, SAAS_CONFIG_FILE_NAME);\n const content = readFileSync(filePath, 'utf8');\n return excluded\n .filter((capability) => readEngineCapabilityEnabled({ filePath, content, capability }) === true)\n .map((capability) => ({\n capability,\n remedy: `The ${lineDeclaration.line} line never has ${capability}, and ${SAAS_CONFIG_FILE_NAME} enables it: set \\`engineCapabilities[EngineCapability.${capability}].enabled\\` to false (and remove its provider), or answer the line question again if the application is not a ${lineDeclaration.line}.`,\n }));\n }\n\n /**\n * An operator serving its clients (#2305): an organization type that owns the application, and an organization\n * relationship through which it serves the others. `wildo init --line service_firm` lays it down whole; on an\n * application whose line was chosen later it is laid down BESIDE what the configuration declares (#2968, the\n * runtime's `layDownOperatorWithClients` says exactly what is added and what is left out). What only the creator can\n * decide is reported owed, with nothing written.\n *\n * An organization's type is fixed when it is created, so after first boot an added owner type reaches no existing\n * organization until the operator's own is promoted into it: the steps are named in `afterFirstBoot`.\n */\n private layDownOperatorWithClients(\n decision: { readonly required: boolean; readonly basis: string; readonly structure?: ApplicationOrganizationStructure },\n applicationRoot: string,\n dryRun: boolean,\n organizationsEnabledByThisRun: boolean,\n ): NonNullable<FoundationExecutionResult['applicationOwnership']> {\n let layout: ReturnType<typeof layDownOperatorWithClients>;\n try {\n layout = layDownOperatorWithClients({ applicationRoot, ...(dryRun ? { dryRun: true } : {}), ...(decision.required ? { singleTypeOwnsApplication: true } : {}) });\n } catch (error) {\n return { ...decision, owed: `The operator-with-clients structure could not be laid down: ${describeCaughtError(error)}` };\n }\n const typeRef = layout.ownerTypeRef === undefined ? {} : { organizationTypeRef: layout.ownerTypeRef };\n if (layout.owed !== undefined) return { ...decision, ...typeRef, owed: layout.owed };\n // The structure is declared either way; with ORGANIZATIONS off it has no organizations to act on.\n // A dry run writes no capability, so ORGANIZATIONS this run would enable reads as off: not owed.\n const organizationsOwed = layout.organizationsCapabilityEnabled || organizationsEnabledByThisRun\n ? {}\n : { owed: 'ORGANIZATIONS is not enabled: the operator, its clients and the relationship between them are organizations, so enable `engineCapabilities[EngineCapability.ORGANIZATIONS]` for the structure to take effect.' };\n return {\n ...decision,\n ...typeRef,\n ...organizationsOwed,\n changed: layout.changed,\n summary: layout.changed ? layout.edits.join('; ') : 'The configuration already declares an operator serving its clients.',\n ...(layout.changed\n ? {\n afterFirstBoot: 'If this application has already been initialized, run `wildo config reapply-declaration` so the stored declaration carries the new types and relationship.'\n + (layout.ownerTypeAdded\n ? ` The organizations that exist keep their types, so the operator's own organization is promoted into \\`${layout.ownerTypeRef}\\` with \\`organizations.promoteToOwnerOrganization\\`, by a platform super-administrator who is a member of it, with a justification.`\n + ` \\`${layout.ownerTypeRef}\\` grants the user types and offers the roles of the type it copied, which the promotion requires; it still refuses an organization holding an unrevoked SCIM token when the two types disagree on \\`scimProvisioning\\`.`\n + ' The other organizations stay tenants and may now grant the relationship.'\n : '')\n + (layout.typesAdded.length > 0\n ? ` An organization stored WITHOUT a type is typed at boot from the declared types its members' user types fit; ${layout.typesAdded.map((ref) => `\\`${ref}\\``).join(' and ')} grant${layout.typesAdded.length === 1 ? 's' : ''} the same user types as an existing type, so the next boot cannot tell which it is and refuses, naming it. Let one boot run on the configuration as it was before this, so every existing organization carries its type.`\n : ''),\n }\n : {}),\n };\n }\n\n /**\n * Declare the organization type that owns the application when its line requires one (#1605), BEFORE\n * the first initialization: an organization's type is fixed when it is created, so declaring it after\n * boot would need `wildo config reapply-declaration` and the `organizations.promoteToOwnerOrganization`\n * door. With exactly one declared type the answer is unambiguous; with several it is authoring work,\n * so it is marked owed, never guessed.\n */\n private declareApplicationOwnership(\n decision: { readonly required: boolean; readonly basis: string; readonly structure?: ApplicationOrganizationStructure },\n applicationRoot: string,\n dryRun: boolean,\n /** Whether this run's capability plan enables ORGANIZATIONS (written before this step, except in a dry run). */\n organizationsEnabledByThisRun = false,\n ): NonNullable<FoundationExecutionResult['applicationOwnership']> {\n if (decision.structure === ApplicationOrganizationStructure.OPERATOR_WITH_CLIENTS) return this.layDownOperatorWithClients(decision, applicationRoot, dryRun, organizationsEnabledByThisRun);\n if (!decision.required) return decision;\n /*\n * #2305 review: a configuration a firm feature line shaped keeps its operator and clients after that line is\n * abandoned (nothing is removed). An owner already declared answers the question, so it is not re-asked; a serving\n * relationship nobody asks for any more is NAMED, because the dossier now says one owner while the configuration\n * still signs clients up (and the privacy notice, read from the dossier, would be addressed to the wrong readers).\n */\n const existing = readSaasConfigOperatorWithClients(applicationRoot);\n if (existing?.ownerTypeRef !== undefined) {\n return {\n ...decision,\n organizationTypeRef: existing.ownerTypeRef,\n changed: false,\n summary: `\\`${existing.ownerTypeRef}\\` already owns the application.`,\n ...(existing.servingRelationshipKey === undefined\n ? {}\n : { owed: `The configuration still serves clients through the \\`${existing.servingRelationshipKey}\\` relationship, while no line asks for the firm's structure any more. If the firm's features were abandoned, remove the relationship and the client organization types by hand; if not, reopen the feature line that needs the firm's method.` }),\n };\n }\n const organizationTypeRefs = listSaasConfigOrganizationTypeRefs({ applicationRoot });\n if (organizationTypeRefs.length !== 1) {\n return {\n ...decision,\n owed: organizationTypeRefs.length === 0\n ? 'The configuration declares no organization type; declare the one that owns the application, with `ownsApplication: true`.'\n : `The configuration declares ${organizationTypeRefs.length} organization types (${organizationTypeRefs.join(', ')}); `\n + 'mark the one that owns the application with `ownsApplication: true`.',\n };\n }\n const organizationTypeRef = organizationTypeRefs[0]!;\n const result = setOrganizationTypeOwnsApplication({ applicationRoot, organizationTypeRef, ownsApplication: true, ...(dryRun ? { dryRun: true } : {}) });\n /*\n * Declared NOW, the type reaches an application that has usually booted already (the line was chosen in the\n * interview, which runs on a started stack): the organization created at that boot keeps its type until the\n * documented door promotes it. An application created with `wildo init --line` or a line blueprint has it before\n * its first boot and this never fires (#1605).\n */\n return {\n ...decision,\n organizationTypeRef,\n changed: result.changed,\n summary: result.summary,\n ...(result.changed\n ? { afterFirstBoot: `If this application has already been initialized, its existing organization keeps the type it was created with: run \\`wildo config reapply-declaration\\`, then promote it with \\`organizations.promoteToOwnerOrganization\\`.` }\n : {}),\n };\n }\n\n /**\n * A landed family VALUE (the business model, the capability composition, the integration plan, the dossier), or\n * `undefined` when this application has none. Written for the business model, which the reasoning below names.\n *\n * ## Why the executor reads it rather than being handed it\n *\n * The run service resolves every landed family into one `artifactsByFamily` map and passes this\n * executor the domain plan alone. Widening that hand-off is the tidier change and it is NOT the one\n * made here: that file is being actively worked by another lane, and the export field this needs is\n * already named once in the semantic-authority bindings — so reading it through the SAME binding is\n * a second door onto one vocabulary rather than a second copy of it.\n *\n * ## Lenient about absence, never about what could not be read\n *\n * Absent answers `undefined`, and the derivation treats that as \"this decides nothing\".\n * `bottom_up.foundation` gates on `domain-plan` and `vision-brief` alone, so an eligible run legitimately has no\n * business model: refusing here would turn one of its OPTIONAL declared inputs into a precondition, which is the shape\n * `application-creation-directive.md` forbids.\n *\n * What could not be read is not absent, so it THROWS (#3258): a package that does not load, or a family a failed\n * module left unavailable. It used to answer `undefined` too, which silently shrank the derived capability set, and a\n * step owing nothing landed without running. Every caller decides what that means to it.\n */\n private async readLandedFamilyValue(family: 'domain-plan' | 'business-model' | 'capability-composition' | 'integration-plan' | 'creator-inputs'): Promise<unknown> {\n const binding = APPLICATION_SPECIFICATION_SEMANTIC_SCHEMA_BINDINGS.find((entry) => entry.family === family);\n if (binding?.companionExportsField === undefined) return undefined;\n // No specifications package is a legitimate state, with nothing landed in it.\n if (this.companionContext.resolvedSpecifications == null) return undefined;\n const exports = await loadSpecificationFamilyData(this.companionContext);\n return (exports as unknown as Record<string, unknown>)[binding.companionExportsField] ?? undefined;\n }\n\n /**\n * Every application-relative target a scenario invocation would write or edit, planned exactly as a dry run plans it\n * and never applied (#3237 review H1): for an invocation found already composed, what the run still composes. A plan\n * that cannot be made (a collision, a missing scenario) names nothing: the witness directory still stands for it.\n */\n private planInvocationTargets(input: {\n readonly invocation: FoundationScenarioInvocation;\n readonly applicationRoot: string;\n readonly scenarioDirectoriesByRef: ReadonlyMap<string, string>;\n readonly renderer: CompositionTemplateRenderer;\n }): readonly string[] {\n const scenarioDirectory = input.scenarioDirectoriesByRef.get(input.invocation.scenarioRef);\n if (!scenarioDirectory) return [];\n try {\n const scenario = loadCompositionScenario(scenarioDirectory);\n const variables = resolveCompositionScenarioVariables(scenario.manifest, { ...input.invocation.variables });\n const plan = planCompositionScenario({ scenario, applicationRoot: input.applicationRoot, variables, renderer: input.renderer });\n return [...plan.writes, ...plan.skipped, ...plan.edits, ...plan.skippedEdits].map((entry) => entry.targetRelativePath);\n } catch (error) {\n this.logDebug('An already-composed scenario could not be planned; its witness directory stands for it', { scenarioRef: input.invocation.scenarioRef, error: describeCaughtError(error) });\n return [];\n }\n }\n\n private applyInvocation(input: {\n readonly invocation: FoundationScenarioInvocation;\n readonly applicationRoot: string;\n readonly scenarioDirectoriesByRef: ReadonlyMap<string, string>;\n readonly renderer: CompositionTemplateRenderer;\n readonly dryRun: boolean;\n /** Told each file the applied scenario writes or edits (#3237). */\n readonly noteWrite?: (filePath: string) => void;\n }): FoundationScenarioExecutionRecord {\n const scenarioDirectory = input.scenarioDirectoriesByRef.get(input.invocation.scenarioRef);\n if (!scenarioDirectory) {\n throw new FoundationExecutionError(\n `The \"${input.invocation.scenarioRef}\" composition scenario is not available to this application `\n + '(neither the app-delivered templates nor a framework checkout carries it).',\n );\n }\n const scenario = loadCompositionScenario(scenarioDirectory);\n const variables = resolveCompositionScenarioVariables(scenario.manifest, { ...input.invocation.variables });\n const plan = planCompositionScenario({ scenario, applicationRoot: input.applicationRoot, variables, renderer: input.renderer });\n const subject = input.invocation.variables['resourceDir']\n ? `${input.invocation.variables['moduleId']}/${input.invocation.variables['resourceDir']}`\n : input.invocation.variables['moduleId'] !== undefined\n ? String(input.invocation.variables['moduleId'])\n : (COMPOSED_WITNESS_DIRECTORY[input.invocation.scenarioRef]?.(input.invocation.variables) ?? input.invocation.scenarioRef);\n if (plan.collisions.length > 0) {\n // The engine's never-half-apply invariant: a collision means the application EDITED a target\n // this scenario would rewrite. Refusing with the paths is the honest outcome — the creator\n // reconciles (git is the undo), then re-runs; foundation never overwrites authored work.\n throw new FoundationExecutionError(\n `Composing ${input.invocation.scenarioRef} for ${subject} collides with existing application files: `\n + plan.collisions.join(', ')\n + ' — reconcile them (the application owns those bytes) and re-run.',\n );\n }\n if (!input.dryRun) {\n // Named BEFORE the apply, so an apply that fails part-way still declares what it may have written (#3237 review N3).\n // A named file the apply never reached changed nothing, and the landing records only what changed.\n for (const write of plan.writes) input.noteWrite?.(write.targetRelativePath);\n for (const edit of plan.edits) input.noteWrite?.(edit.targetRelativePath);\n applyCompositionScenarioPlan({ plan, applicationRoot: input.applicationRoot });\n }\n return {\n scenarioRef: input.invocation.scenarioRef,\n subject,\n writes: plan.writes.length,\n skippedWrites: plan.skipped.length,\n editsApplied: plan.edits.length,\n skippedEdits: plan.skippedEdits.length,\n };\n }\n\n /**\n * The tenancy model, from the PLAN first and the interview second.\n *\n * The plan wins because it is the committed artifact: a creator who answered the question on\n * `bottom_up.domain-plan` has already had that answer shape the modules and relationships, and\n * re-asking here would let a second answer contradict a model built on the first.\n *\n * The elicitation fallback stays for plans authored before `tenancy` existed on the family schema\n * (wonder-crm and wonder-todos are both such plans). Neither source present is still a refusal:\n * the executor deliberately does not derive this.\n */\n private resolvePrimaryScope(\n domainPlan: unknown,\n answers: ReadonlyArray<{ readonly questionRef: string; readonly answer: string }>,\n ): FoundationPrimaryScope {\n const parsed = DomainPlanOutputSetSchema.safeParse(domainPlan);\n if (parsed.success && parsed.data.tenancy !== undefined) return parsed.data.tenancy;\n const answer = answers.find((candidate) => candidate.questionRef === 'primary-scope')?.answer?.trim();\n if (answer === FoundationPrimaryScope.ORGANIZATIONS || answer === FoundationPrimaryScope.USERS) return answer;\n throw new FoundationExecutionError(\n 'The tenancy model is a creator decision the executor deliberately does not derive, and neither '\n + 'source supplied it: the domain plan carries no `tenancy`, and no \"primary-scope\" elicitation '\n + 'answer (\"organizations\" or \"users\") was given.'\n + (answer ? ` Received answer: \"${answer}\".` : ''),\n );\n }\n\n private readSharedLibPackageName(applicationRoot: string): string {\n const manifestPath = join(applicationRoot, 'shared-lib', 'package.json');\n try {\n const name = (JSON.parse(readFileSync(manifestPath, 'utf8')) as { name?: string }).name;\n if (name) return name;\n } catch {\n // fall through to the named refusal below\n }\n throw new FoundationExecutionError(`Cannot read the shared-lib package name at ${manifestPath} — not a composed application root.`);\n }\n\n /**\n * Whether the landed integration plan declares a minion — read leniently, because an unparseable\n * plan declares nothing and the derivation reads it the same way.\n */\n private declaresAMinion(integrationPlan: unknown): boolean {\n const minions = (integrationPlan as { minions?: unknown } | null)?.minions;\n return Array.isArray(minions) && minions.length > 0;\n }\n\n /**\n * The backend-api package name — a minion's package re-derives the application's initialization\n * from it, so `add-minion` binds it as a variable. Read the same way as the shared-lib name, and\n * refusing the same way: a composed application root has both, and a minion composed against a\n * guessed package name produces a package that cannot resolve its own initialization.\n */\n private readBackendApiPackageName(applicationRoot: string): string {\n const manifestPath = join(applicationRoot, 'backend-api', 'package.json');\n try {\n const name = (JSON.parse(readFileSync(manifestPath, 'utf8')) as { name?: string }).name;\n if (name) return name;\n } catch {\n // fall through to the named refusal below\n }\n throw new FoundationExecutionError(`Cannot read the backend-api package name at ${manifestPath} — not a composed application root.`);\n }\n}\n"]}