@wildo-ai/dev-companion 1.1.8 → 1.1.9

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 (325) hide show
  1. package/bin/companion-supervisor.d.mts +33 -0
  2. package/bin/companion-supervisor.mjs +174 -0
  3. package/bin/wildo-dev-companion-supervised.mjs +16 -0
  4. package/dist/esm/brand/models/logo-generation.actors-system.definitions.d.ts.map +1 -1
  5. package/dist/esm/brand/models/logo-generation.actors-system.definitions.js +8 -2
  6. package/dist/esm/brand/models/logo-generation.actors-system.definitions.js.map +1 -1
  7. package/dist/esm/brand/models/logo-judge.actors-system.definitions.d.ts.map +1 -1
  8. package/dist/esm/brand/models/logo-judge.actors-system.definitions.js +8 -2
  9. package/dist/esm/brand/models/logo-judge.actors-system.definitions.js.map +1 -1
  10. package/dist/esm/brand/services/brand-accept.companion.service.d.ts +1 -1
  11. package/dist/esm/brand/services/brand-accept.companion.service.d.ts.map +1 -1
  12. package/dist/esm/brand/services/brand-accept.companion.service.js +9 -11
  13. package/dist/esm/brand/services/brand-accept.companion.service.js.map +1 -1
  14. package/dist/esm/claude-cli/models/application-coding-run-checkpoint.models.d.ts +21 -0
  15. package/dist/esm/claude-cli/models/application-coding-run-checkpoint.models.d.ts.map +1 -1
  16. package/dist/esm/claude-cli/models/application-coding-run-checkpoint.models.js +33 -1
  17. package/dist/esm/claude-cli/models/application-coding-run-checkpoint.models.js.map +1 -1
  18. package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts +41 -2
  19. package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts.map +1 -1
  20. package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js +43 -1
  21. package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js.map +1 -1
  22. package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.d.ts +57 -1
  23. package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.d.ts.map +1 -1
  24. package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.js +75 -1
  25. package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.js.map +1 -1
  26. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.d.ts +90 -5
  27. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.d.ts.map +1 -1
  28. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js +242 -22
  29. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js.map +1 -1
  30. package/dist/esm/companion-api/companion-api.schemas.d.ts +23 -2
  31. package/dist/esm/companion-api/companion-api.schemas.d.ts.map +1 -1
  32. package/dist/esm/companion-api/companion-api.schemas.js +13 -2
  33. package/dist/esm/companion-api/companion-api.schemas.js.map +1 -1
  34. package/dist/esm/companion-api/controllers/companion.controller.d.ts +63 -7
  35. package/dist/esm/companion-api/controllers/companion.controller.d.ts.map +1 -1
  36. package/dist/esm/companion-api/controllers/companion.controller.js +315 -39
  37. package/dist/esm/companion-api/controllers/companion.controller.js.map +1 -1
  38. package/dist/esm/core/config/primary-language.companion.utils.d.ts +5 -4
  39. package/dist/esm/core/config/primary-language.companion.utils.d.ts.map +1 -1
  40. package/dist/esm/core/config/primary-language.companion.utils.js +5 -4
  41. package/dist/esm/core/config/primary-language.companion.utils.js.map +1 -1
  42. package/dist/esm/core/context/application-module-generations.companion.d.ts +103 -0
  43. package/dist/esm/core/context/application-module-generations.companion.d.ts.map +1 -0
  44. package/dist/esm/core/context/application-module-generations.companion.js +313 -0
  45. package/dist/esm/core/context/application-module-generations.companion.js.map +1 -0
  46. package/dist/esm/core/context/companion-package-loaders.companion.d.ts +19 -19
  47. package/dist/esm/core/context/companion-package-loaders.companion.d.ts.map +1 -1
  48. package/dist/esm/core/context/companion-package-loaders.companion.js +52 -40
  49. package/dist/esm/core/context/companion-package-loaders.companion.js.map +1 -1
  50. package/dist/esm/core/inject/models/container.d.ts.map +1 -1
  51. package/dist/esm/core/inject/models/container.js +4 -0
  52. package/dist/esm/core/inject/models/container.js.map +1 -1
  53. package/dist/esm/core/inject/models/service-types.d.ts +4 -0
  54. package/dist/esm/core/inject/models/service-types.d.ts.map +1 -1
  55. package/dist/esm/core/inject/models/service-types.js +4 -0
  56. package/dist/esm/core/inject/models/service-types.js.map +1 -1
  57. package/dist/esm/core/introspection/resources/creation-console-answer.companion.d.ts +15 -1
  58. package/dist/esm/core/introspection/resources/creation-console-answer.companion.d.ts.map +1 -1
  59. package/dist/esm/core/introspection/resources/creation-console-answer.companion.js +38 -3
  60. package/dist/esm/core/introspection/resources/creation-console-answer.companion.js.map +1 -1
  61. package/dist/esm/core/introspection/resources/creation-console-projection.companion.d.ts +21 -0
  62. package/dist/esm/core/introspection/resources/creation-console-projection.companion.d.ts.map +1 -1
  63. package/dist/esm/core/introspection/resources/creation-console-projection.companion.js +64 -25
  64. package/dist/esm/core/introspection/resources/creation-console-projection.companion.js.map +1 -1
  65. package/dist/esm/core/introspection/resources/creation-home-projection.companion.d.ts.map +1 -1
  66. package/dist/esm/core/introspection/resources/creation-home-projection.companion.js +2 -0
  67. package/dist/esm/core/introspection/resources/creation-home-projection.companion.js.map +1 -1
  68. package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.d.ts +0 -28
  69. package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.d.ts.map +1 -1
  70. package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.js +192 -19
  71. package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.js.map +1 -1
  72. package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.d.ts.map +1 -1
  73. package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.js +27 -5
  74. package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.js.map +1 -1
  75. package/dist/esm/core/introspection/resources/launch-blockers.companion.d.ts +47 -0
  76. package/dist/esm/core/introspection/resources/launch-blockers.companion.d.ts.map +1 -0
  77. package/dist/esm/core/introspection/resources/launch-blockers.companion.js +98 -0
  78. package/dist/esm/core/introspection/resources/launch-blockers.companion.js.map +1 -0
  79. package/dist/esm/core/introspection/services/companion-introspection.companion.service.d.ts +6 -1
  80. package/dist/esm/core/introspection/services/companion-introspection.companion.service.d.ts.map +1 -1
  81. package/dist/esm/core/introspection/services/companion-introspection.companion.service.js +20 -1
  82. package/dist/esm/core/introspection/services/companion-introspection.companion.service.js.map +1 -1
  83. package/dist/esm/core/introspection/services/introspection-derivation-state.companion.service.d.ts +34 -8
  84. package/dist/esm/core/introspection/services/introspection-derivation-state.companion.service.d.ts.map +1 -1
  85. package/dist/esm/core/introspection/services/introspection-derivation-state.companion.service.js +61 -12
  86. package/dist/esm/core/introspection/services/introspection-derivation-state.companion.service.js.map +1 -1
  87. package/dist/esm/core/introspection/services/introspection-input-closure.companion.d.ts +44 -0
  88. package/dist/esm/core/introspection/services/introspection-input-closure.companion.d.ts.map +1 -0
  89. package/dist/esm/core/introspection/services/introspection-input-closure.companion.js +104 -0
  90. package/dist/esm/core/introspection/services/introspection-input-closure.companion.js.map +1 -0
  91. package/dist/esm/core/introspection/services/introspection-source-state.companion.service.d.ts +41 -22
  92. package/dist/esm/core/introspection/services/introspection-source-state.companion.service.d.ts.map +1 -1
  93. package/dist/esm/core/introspection/services/introspection-source-state.companion.service.js +64 -47
  94. package/dist/esm/core/introspection/services/introspection-source-state.companion.service.js.map +1 -1
  95. package/dist/esm/core/introspection/subprocess/expert-persona-brief.renderer.d.ts +7 -1
  96. package/dist/esm/core/introspection/subprocess/expert-persona-brief.renderer.d.ts.map +1 -1
  97. package/dist/esm/core/introspection/subprocess/expert-persona-brief.renderer.js +13 -4
  98. package/dist/esm/core/introspection/subprocess/expert-persona-brief.renderer.js.map +1 -1
  99. package/dist/esm/core/introspection/subprocess/specification-artifacts.behavior.d.ts.map +1 -1
  100. package/dist/esm/core/introspection/subprocess/specification-artifacts.behavior.js +7 -0
  101. package/dist/esm/core/introspection/subprocess/specification-artifacts.behavior.js.map +1 -1
  102. package/dist/esm/core/lock/wildo-saas-lock.schemas.d.ts +4 -4
  103. package/dist/esm/core/runtime/companion-env-file.d.ts +39 -9
  104. package/dist/esm/core/runtime/companion-env-file.d.ts.map +1 -1
  105. package/dist/esm/core/runtime/companion-env-file.js +75 -16
  106. package/dist/esm/core/runtime/companion-env-file.js.map +1 -1
  107. package/dist/esm/core/runtime/services/start-companion-application.service.d.ts +7 -3
  108. package/dist/esm/core/runtime/services/start-companion-application.service.d.ts.map +1 -1
  109. package/dist/esm/core/runtime/services/start-companion-application.service.js +29 -11
  110. package/dist/esm/core/runtime/services/start-companion-application.service.js.map +1 -1
  111. package/dist/esm/core/utils/bounded-concurrency.utils.d.ts +17 -0
  112. package/dist/esm/core/utils/bounded-concurrency.utils.d.ts.map +1 -0
  113. package/dist/esm/core/utils/bounded-concurrency.utils.js +37 -0
  114. package/dist/esm/core/utils/bounded-concurrency.utils.js.map +1 -0
  115. package/dist/esm/core/utils/derived-input-signature.companion.utils.d.ts +10 -1
  116. package/dist/esm/core/utils/derived-input-signature.companion.utils.d.ts.map +1 -1
  117. package/dist/esm/core/utils/derived-input-signature.companion.utils.js +9 -2
  118. package/dist/esm/core/utils/derived-input-signature.companion.utils.js.map +1 -1
  119. package/dist/esm/creation-conversation/creation-conversation.actors-system.definitions.d.ts.map +1 -1
  120. package/dist/esm/creation-conversation/creation-conversation.actors-system.definitions.js +2 -0
  121. package/dist/esm/creation-conversation/creation-conversation.actors-system.definitions.js.map +1 -1
  122. package/dist/esm/creation-conversation/creation-conversation.function-tools.d.ts.map +1 -1
  123. package/dist/esm/creation-conversation/creation-conversation.function-tools.js +66 -6
  124. package/dist/esm/creation-conversation/creation-conversation.function-tools.js.map +1 -1
  125. package/dist/esm/deliberations/models/deliberation-agents.actors-system.definitions.d.ts +0 -17
  126. package/dist/esm/deliberations/models/deliberation-agents.actors-system.definitions.d.ts.map +1 -1
  127. package/dist/esm/deliberations/models/deliberation-agents.actors-system.definitions.js +10 -4
  128. package/dist/esm/deliberations/models/deliberation-agents.actors-system.definitions.js.map +1 -1
  129. package/dist/esm/email/services/email-template.companion.service.d.ts +6 -1
  130. package/dist/esm/email/services/email-template.companion.service.d.ts.map +1 -1
  131. package/dist/esm/email/services/email-template.companion.service.js +4 -1
  132. package/dist/esm/email/services/email-template.companion.service.js.map +1 -1
  133. package/dist/esm/expert-personas/models/expert-persona-critique.actors-system.definitions.d.ts.map +1 -1
  134. package/dist/esm/expert-personas/models/expert-persona-critique.actors-system.definitions.js +8 -2
  135. package/dist/esm/expert-personas/models/expert-persona-critique.actors-system.definitions.js.map +1 -1
  136. package/dist/esm/expert-personas/models/expert-persona-derivation.actors-system.definitions.d.ts.map +1 -1
  137. package/dist/esm/expert-personas/models/expert-persona-derivation.actors-system.definitions.js +8 -2
  138. package/dist/esm/expert-personas/models/expert-persona-derivation.actors-system.definitions.js.map +1 -1
  139. package/dist/esm/expert-personas/services/expert-persona.companion.service.d.ts.map +1 -1
  140. package/dist/esm/expert-personas/services/expert-persona.companion.service.js +7 -7
  141. package/dist/esm/expert-personas/services/expert-persona.companion.service.js.map +1 -1
  142. package/dist/esm/i18n/composite_views/app.creation-conversation.en.d.ts.map +1 -1
  143. package/dist/esm/i18n/composite_views/app.creation-conversation.en.js +41 -1
  144. package/dist/esm/i18n/composite_views/app.creation-conversation.en.js.map +1 -1
  145. package/dist/esm/i18n/resources/workbenchAspects.en.d.ts.map +1 -1
  146. package/dist/esm/i18n/resources/workbenchAspects.en.js +7 -0
  147. package/dist/esm/i18n/resources/workbenchAspects.en.js.map +1 -1
  148. package/dist/esm/i18n/resources/workbenchBuildDispatchPlan.en.d.ts +5 -0
  149. package/dist/esm/i18n/resources/workbenchBuildDispatchPlan.en.d.ts.map +1 -1
  150. package/dist/esm/i18n/resources/workbenchBuildDispatchPlan.en.js +5 -0
  151. package/dist/esm/i18n/resources/workbenchBuildDispatchPlan.en.js.map +1 -1
  152. package/dist/esm/i18n/resources/workbenchBuildPlanTasks.en.d.ts +1 -1
  153. package/dist/esm/i18n/resources/workbenchBuildPlanTasks.en.d.ts.map +1 -1
  154. package/dist/esm/i18n/resources/workbenchBuildPlanTasks.en.js +2 -1
  155. package/dist/esm/i18n/resources/workbenchBuildPlanTasks.en.js.map +1 -1
  156. package/dist/esm/i18n/resources/workbenchDossierEntries.en.d.ts +46 -0
  157. package/dist/esm/i18n/resources/workbenchDossierEntries.en.d.ts.map +1 -1
  158. package/dist/esm/i18n/resources/workbenchDossierEntries.en.js +12 -0
  159. package/dist/esm/i18n/resources/workbenchDossierEntries.en.js.map +1 -1
  160. package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts +266 -0
  161. package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts.map +1 -1
  162. package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.js +91 -5
  163. package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.js.map +1 -1
  164. package/dist/esm/i18n/system_enums/application-creation.en.d.ts +41 -0
  165. package/dist/esm/i18n/system_enums/application-creation.en.d.ts.map +1 -1
  166. package/dist/esm/i18n/system_enums/application-creation.en.js +45 -1
  167. package/dist/esm/i18n/system_enums/application-creation.en.js.map +1 -1
  168. package/dist/esm/i18n/system_enums/localization.en.d.ts +82 -0
  169. package/dist/esm/i18n/system_enums/localization.en.d.ts.map +1 -0
  170. package/dist/esm/i18n/system_enums/localization.en.js +82 -0
  171. package/dist/esm/i18n/system_enums/localization.en.js.map +1 -0
  172. package/dist/esm/i18n/system_enums/risk-register.en.d.ts +1 -0
  173. package/dist/esm/i18n/system_enums/risk-register.en.d.ts.map +1 -1
  174. package/dist/esm/i18n/system_enums/risk-register.en.js +1 -0
  175. package/dist/esm/i18n/system_enums/risk-register.en.js.map +1 -1
  176. package/dist/esm/i18n/system_enums/workbench-dossier.en.d.ts +10 -0
  177. package/dist/esm/i18n/system_enums/workbench-dossier.en.d.ts.map +1 -1
  178. package/dist/esm/i18n/system_enums/workbench-dossier.en.js +13 -0
  179. package/dist/esm/i18n/system_enums/workbench-dossier.en.js.map +1 -1
  180. package/dist/esm/i18n-labelling/models/labelling-progress.models.d.ts +43 -0
  181. package/dist/esm/i18n-labelling/models/labelling-progress.models.d.ts.map +1 -0
  182. package/dist/esm/i18n-labelling/models/labelling-progress.models.js +34 -0
  183. package/dist/esm/i18n-labelling/models/labelling-progress.models.js.map +1 -0
  184. package/dist/esm/i18n-labelling/services/labellize-orchestrator.companion.service.d.ts +8 -0
  185. package/dist/esm/i18n-labelling/services/labellize-orchestrator.companion.service.d.ts.map +1 -1
  186. package/dist/esm/i18n-labelling/services/labellize-orchestrator.companion.service.js +97 -56
  187. package/dist/esm/i18n-labelling/services/labellize-orchestrator.companion.service.js.map +1 -1
  188. package/dist/esm/i18n-labelling/services/translate-orchestrator.companion.service.d.ts +18 -0
  189. package/dist/esm/i18n-labelling/services/translate-orchestrator.companion.service.d.ts.map +1 -1
  190. package/dist/esm/i18n-labelling/services/translate-orchestrator.companion.service.js +269 -153
  191. package/dist/esm/i18n-labelling/services/translate-orchestrator.companion.service.js.map +1 -1
  192. package/dist/esm/i18n-labelling/utils/labelling-concurrency.utils.d.ts +41 -0
  193. package/dist/esm/i18n-labelling/utils/labelling-concurrency.utils.d.ts.map +1 -0
  194. package/dist/esm/i18n-labelling/utils/labelling-concurrency.utils.js +47 -0
  195. package/dist/esm/i18n-labelling/utils/labelling-concurrency.utils.js.map +1 -0
  196. package/dist/esm/i18n-labelling/utils/per-unit-file.utils.d.ts +12 -0
  197. package/dist/esm/i18n-labelling/utils/per-unit-file.utils.d.ts.map +1 -1
  198. package/dist/esm/i18n-labelling/utils/per-unit-file.utils.js +10 -2
  199. package/dist/esm/i18n-labelling/utils/per-unit-file.utils.js.map +1 -1
  200. package/dist/esm/i18n-labelling/utils/staged-label-file-writer.utils.d.ts +89 -0
  201. package/dist/esm/i18n-labelling/utils/staged-label-file-writer.utils.d.ts.map +1 -0
  202. package/dist/esm/i18n-labelling/utils/staged-label-file-writer.utils.js +229 -0
  203. package/dist/esm/i18n-labelling/utils/staged-label-file-writer.utils.js.map +1 -0
  204. package/dist/esm/meta-workflows/models/build-task-rearm.models.d.ts +67 -1
  205. package/dist/esm/meta-workflows/models/build-task-rearm.models.d.ts.map +1 -1
  206. package/dist/esm/meta-workflows/models/build-task-rearm.models.js +64 -0
  207. package/dist/esm/meta-workflows/models/build-task-rearm.models.js.map +1 -1
  208. package/dist/esm/meta-workflows/models/creation-intervention.models.d.ts +308 -0
  209. package/dist/esm/meta-workflows/models/creation-intervention.models.d.ts.map +1 -0
  210. package/dist/esm/meta-workflows/models/creation-intervention.models.js +365 -0
  211. package/dist/esm/meta-workflows/models/creation-intervention.models.js.map +1 -0
  212. package/dist/esm/meta-workflows/models/generation-step-progress.models.d.ts +61 -0
  213. package/dist/esm/meta-workflows/models/generation-step-progress.models.d.ts.map +1 -0
  214. package/dist/esm/meta-workflows/models/generation-step-progress.models.js +58 -0
  215. package/dist/esm/meta-workflows/models/generation-step-progress.models.js.map +1 -0
  216. package/dist/esm/meta-workflows/models/meta-workflows-lane.models.d.ts +10 -6
  217. package/dist/esm/meta-workflows/models/meta-workflows-lane.models.d.ts.map +1 -1
  218. package/dist/esm/meta-workflows/models/meta-workflows-lane.models.js +11 -6
  219. package/dist/esm/meta-workflows/models/meta-workflows-lane.models.js.map +1 -1
  220. package/dist/esm/meta-workflows/models/playbook-run-checkpoint.models.d.ts +3 -0
  221. package/dist/esm/meta-workflows/models/playbook-run-checkpoint.models.d.ts.map +1 -1
  222. package/dist/esm/meta-workflows/models/playbook-run-checkpoint.models.js +8 -1
  223. package/dist/esm/meta-workflows/models/playbook-run-checkpoint.models.js.map +1 -1
  224. package/dist/esm/meta-workflows/models/playbook-run-record.models.d.ts +26 -0
  225. package/dist/esm/meta-workflows/models/playbook-run-record.models.d.ts.map +1 -1
  226. package/dist/esm/meta-workflows/models/playbook-run-record.models.js +66 -10
  227. package/dist/esm/meta-workflows/models/playbook-run-record.models.js.map +1 -1
  228. package/dist/esm/meta-workflows/services/application-assembly-checks.companion.utils.d.ts +13 -0
  229. package/dist/esm/meta-workflows/services/application-assembly-checks.companion.utils.d.ts.map +1 -0
  230. package/dist/esm/meta-workflows/services/application-assembly-checks.companion.utils.js +33 -0
  231. package/dist/esm/meta-workflows/services/application-assembly-checks.companion.utils.js.map +1 -0
  232. package/dist/esm/meta-workflows/services/application-assembly-repair.companion.utils.d.ts +145 -0
  233. package/dist/esm/meta-workflows/services/application-assembly-repair.companion.utils.d.ts.map +1 -0
  234. package/dist/esm/meta-workflows/services/application-assembly-repair.companion.utils.js +179 -0
  235. package/dist/esm/meta-workflows/services/application-assembly-repair.companion.utils.js.map +1 -0
  236. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts +376 -17
  237. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts.map +1 -1
  238. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js +805 -39
  239. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js.map +1 -1
  240. package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.d.ts +93 -7
  241. package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.d.ts.map +1 -1
  242. package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.js +142 -25
  243. package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.js.map +1 -1
  244. package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.d.ts +120 -3
  245. package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.d.ts.map +1 -1
  246. package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.js +325 -16
  247. package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.js.map +1 -1
  248. package/dist/esm/meta-workflows/services/application-build-website-context.companion.service.d.ts.map +1 -1
  249. package/dist/esm/meta-workflows/services/application-build-website-context.companion.service.js +15 -6
  250. package/dist/esm/meta-workflows/services/application-build-website-context.companion.service.js.map +1 -1
  251. package/dist/esm/meta-workflows/services/application-maturity-executor.companion.service.d.ts.map +1 -1
  252. package/dist/esm/meta-workflows/services/application-maturity-executor.companion.service.js +10 -11
  253. package/dist/esm/meta-workflows/services/application-maturity-executor.companion.service.js.map +1 -1
  254. package/dist/esm/meta-workflows/services/capability-composition-executor.companion.service.d.ts.map +1 -1
  255. package/dist/esm/meta-workflows/services/capability-composition-executor.companion.service.js +10 -11
  256. package/dist/esm/meta-workflows/services/capability-composition-executor.companion.service.js.map +1 -1
  257. package/dist/esm/meta-workflows/services/creation-intervention-ledger.companion.service.d.ts +82 -0
  258. package/dist/esm/meta-workflows/services/creation-intervention-ledger.companion.service.d.ts.map +1 -0
  259. package/dist/esm/meta-workflows/services/creation-intervention-ledger.companion.service.js +291 -0
  260. package/dist/esm/meta-workflows/services/creation-intervention-ledger.companion.service.js.map +1 -0
  261. package/dist/esm/meta-workflows/services/creation-lane-preflight.companion.service.d.ts +60 -0
  262. package/dist/esm/meta-workflows/services/creation-lane-preflight.companion.service.d.ts.map +1 -0
  263. package/dist/esm/meta-workflows/services/creation-lane-preflight.companion.service.js +66 -0
  264. package/dist/esm/meta-workflows/services/creation-lane-preflight.companion.service.js.map +1 -0
  265. package/dist/esm/meta-workflows/services/creation-run-report.companion.service.d.ts +53 -0
  266. package/dist/esm/meta-workflows/services/creation-run-report.companion.service.d.ts.map +1 -0
  267. package/dist/esm/meta-workflows/services/creation-run-report.companion.service.js +164 -0
  268. package/dist/esm/meta-workflows/services/creation-run-report.companion.service.js.map +1 -0
  269. package/dist/esm/meta-workflows/services/dossier-write-queue.companion.utils.d.ts +37 -0
  270. package/dist/esm/meta-workflows/services/dossier-write-queue.companion.utils.d.ts.map +1 -0
  271. package/dist/esm/meta-workflows/services/dossier-write-queue.companion.utils.js +52 -0
  272. package/dist/esm/meta-workflows/services/dossier-write-queue.companion.utils.js.map +1 -0
  273. package/dist/esm/meta-workflows/services/dossier.companion.service.d.ts +74 -14
  274. package/dist/esm/meta-workflows/services/dossier.companion.service.d.ts.map +1 -1
  275. package/dist/esm/meta-workflows/services/dossier.companion.service.js +180 -28
  276. package/dist/esm/meta-workflows/services/dossier.companion.service.js.map +1 -1
  277. package/dist/esm/meta-workflows/services/foundation-executor.companion.service.d.ts +2 -3
  278. package/dist/esm/meta-workflows/services/foundation-executor.companion.service.d.ts.map +1 -1
  279. package/dist/esm/meta-workflows/services/foundation-executor.companion.service.js +2 -8
  280. package/dist/esm/meta-workflows/services/foundation-executor.companion.service.js.map +1 -1
  281. package/dist/esm/meta-workflows/services/interview-answer-proposal.companion.d.ts +67 -0
  282. package/dist/esm/meta-workflows/services/interview-answer-proposal.companion.d.ts.map +1 -0
  283. package/dist/esm/meta-workflows/services/interview-answer-proposal.companion.js +64 -0
  284. package/dist/esm/meta-workflows/services/interview-answer-proposal.companion.js.map +1 -0
  285. package/dist/esm/meta-workflows/services/playbook-instance.companion.service.d.ts.map +1 -1
  286. package/dist/esm/meta-workflows/services/playbook-instance.companion.service.js +11 -3
  287. package/dist/esm/meta-workflows/services/playbook-instance.companion.service.js.map +1 -1
  288. package/dist/esm/meta-workflows/services/playbook-run-write-register.companion.service.d.ts +92 -4
  289. package/dist/esm/meta-workflows/services/playbook-run-write-register.companion.service.d.ts.map +1 -1
  290. package/dist/esm/meta-workflows/services/playbook-run-write-register.companion.service.js +328 -7
  291. package/dist/esm/meta-workflows/services/playbook-run-write-register.companion.service.js.map +1 -1
  292. package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts +105 -6
  293. package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts.map +1 -1
  294. package/dist/esm/meta-workflows/services/playbook-run.companion.service.js +309 -39
  295. package/dist/esm/meta-workflows/services/playbook-run.companion.service.js.map +1 -1
  296. package/dist/esm/meta-workflows/services/playbook-spend-meter.companion.service.d.ts +62 -1
  297. package/dist/esm/meta-workflows/services/playbook-spend-meter.companion.service.d.ts.map +1 -1
  298. package/dist/esm/meta-workflows/services/playbook-spend-meter.companion.service.js +152 -2
  299. package/dist/esm/meta-workflows/services/playbook-spend-meter.companion.service.js.map +1 -1
  300. package/package.json +22 -18
  301. package/dist/esm/.tsbuildinfo +0 -1
  302. package/dist/esm/__tests__/asset-noop.d.ts +0 -3
  303. package/dist/esm/__tests__/asset-noop.d.ts.map +0 -1
  304. package/dist/esm/__tests__/asset-noop.js +0 -2
  305. package/dist/esm/__tests__/asset-noop.js.map +0 -1
  306. package/dist/esm/__tests__/chdir-dogfood-app.setup.d.ts +0 -2
  307. package/dist/esm/__tests__/chdir-dogfood-app.setup.d.ts.map +0 -1
  308. package/dist/esm/__tests__/chdir-dogfood-app.setup.js +0 -44
  309. package/dist/esm/__tests__/chdir-dogfood-app.setup.js.map +0 -1
  310. package/dist/esm/__tests__/internal-test-view.d.ts +0 -39
  311. package/dist/esm/__tests__/internal-test-view.d.ts.map +0 -1
  312. package/dist/esm/__tests__/internal-test-view.js +0 -2
  313. package/dist/esm/__tests__/internal-test-view.js.map +0 -1
  314. package/dist/esm/claude-cli/services/__tests__/support/in-memory-coding-actor-plane.d.ts +0 -50
  315. package/dist/esm/claude-cli/services/__tests__/support/in-memory-coding-actor-plane.d.ts.map +0 -1
  316. package/dist/esm/claude-cli/services/__tests__/support/in-memory-coding-actor-plane.js +0 -157
  317. package/dist/esm/claude-cli/services/__tests__/support/in-memory-coding-actor-plane.js.map +0 -1
  318. package/dist/esm/meta-workflows/services/__tests__/application-build-task-coding.companion.test-fixtures.d.ts +0 -8
  319. package/dist/esm/meta-workflows/services/__tests__/application-build-task-coding.companion.test-fixtures.d.ts.map +0 -1
  320. package/dist/esm/meta-workflows/services/__tests__/application-build-task-coding.companion.test-fixtures.js +0 -43
  321. package/dist/esm/meta-workflows/services/__tests__/application-build-task-coding.companion.test-fixtures.js.map +0 -1
  322. package/dist/esm/meta-workflows/services/__tests__/support/in-memory-actor-plane.d.ts +0 -79
  323. package/dist/esm/meta-workflows/services/__tests__/support/in-memory-actor-plane.d.ts.map +0 -1
  324. package/dist/esm/meta-workflows/services/__tests__/support/in-memory-actor-plane.js +0 -193
  325. package/dist/esm/meta-workflows/services/__tests__/support/in-memory-actor-plane.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"application-build-website-context.companion.service.d.ts","sourceRoot":"","sources":["../../../../../src/meta-workflows/services/application-build-website-context.companion.service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,sBAAsB,EAG5B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAEL,KAAK,aAAa,EAOnB,MAAM,oDAAoD,CAAC;AAI5D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,aAAa,EAAE,gBAAgB,EAAE,OAAO,GAAG,sBAAsB,GAAG,IAAI,CAsE3H;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,aAAa,EAAE,gBAAgB,EAAE,OAAO,GAAG,SAAS,MAAM,EAAE,CAWtG"}
1
+ {"version":3,"file":"application-build-website-context.companion.service.d.ts","sourceRoot":"","sources":["../../../../../src/meta-workflows/services/application-build-website-context.companion.service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,sBAAsB,EAG5B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAEL,KAAK,aAAa,EAOnB,MAAM,oDAAoD,CAAC;AAI5D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,aAAa,EAAE,gBAAgB,EAAE,OAAO,GAAG,sBAAsB,GAAG,IAAI,CA+E3H;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,aAAa,EAAE,gBAAgB,EAAE,OAAO,GAAG,SAAS,MAAM,EAAE,CAWtG"}
@@ -1,6 +1,6 @@
1
1
  import { decidedFamilyValuesFromCompanionExports, indexDecidedAspects, } from '@wildo-ai/application-creation-runtime';
2
2
  import { ApplicationSpecificationFamily, BuildPlanTaskProductKind, BuildPlanTaskTargetKind, WebsitePlanSchema, WEBSITE_SECTION_SKILL_REF, websiteProductSkillRefs, } from '@wildo-ai/saas-specifications/application-creation';
3
- import { websitePageIdentity } from './application-build-task-coding-policy.companion.service.js';
3
+ import { websitePageIdentity, websitePageSectionsListName } from './application-build-task-coding-policy.companion.service.js';
4
4
  /**
5
5
  * WHAT A WEBSITE TASK IS BUILDING — its page or section as the website plan decided it.
6
6
  *
@@ -58,14 +58,21 @@ export function buildWebsitePlanContextSource(task, companionExports) {
58
58
  })),
59
59
  };
60
60
  if (product.kind === BuildPlanTaskProductKind.WEBSITE_PAGE) {
61
- const pageConst = identity.toUpperCase().replace(/[^A-Z0-9]+/g, '_');
61
+ const listName = websitePageSectionsListName(page.pageRef);
62
62
  return [{
63
63
  page: pageView,
64
64
  boundary: `This task authors the PAGE: its route under website/src/pages/, its bridge and page component under `
65
65
  + `website/src/pages-impl/ (${identity}.page.tsx, ${identity}.bridge.tsx), its manifest registered in `
66
66
  + `WEBSITE_PAGE_MANIFESTS in website/src/website-root.config.ts, the page's navigation entry, and `
67
- + `website/src/sections/${identity}.sections.tsx exporting ${pageConst}_SECTIONS, the page's sections list in the reading order above. `
68
- + `Register that list in website/src/sections/index.ts (re-export the file and spread ${pageConst}_SECTIONS into WEBSITE_SECTIONS): `
67
+ + `website/src/sections/${identity}.sections.tsx exporting ${listName}, the page's sections list in the reading order above, `
68
+ // #2224: an unannotated EMPTY array is `never[]`, and the page that maps over it does not compile.
69
+ + `declared with its type — \`export const ${listName}: readonly WebsiteSectionDefinition[] = [];\` — because it starts empty and `
70
+ + 'an unannotated empty array is never[], which the page cannot map over. '
71
+ // #2205: rendered through the engine component, an empty list shows a marked pending block in dev
72
+ // instead of a blank page; `astro build` refuses a page with no section, so it can never ship empty.
73
+ + `The page component renders that list as <WebsitePageSections pageRef="${identity}" sections={${listName}} /> `
74
+ + '(from @wildo-ai/saas-website), never a hand-written map: while the list is empty it shows the page as pending. '
75
+ + `Register that list in website/src/sections/index.ts (re-export the file and spread ${listName} into WEBSITE_SECTIONS): `
69
76
  + 'the label audit and the manifest\'s section resolution read WEBSITE_SECTIONS, so an unregistered list is a page whose sections '
70
77
  + 'nothing checks. '
71
78
  + 'For every locale `wildo.website.config.ts` lists beyond the default, add the route copy under '
@@ -89,8 +96,10 @@ export function buildWebsitePlanContextSource(task, companionExports) {
89
96
  },
90
97
  page: pageView,
91
98
  landing: `Define the section with defineWebsiteSection({ sectionRef: '${section.sectionRef}', … }) in `
92
- + `website/src/sections/${identity}.sections.tsx and add it to that file's sections list at its reading-order position, `
93
- + `with its label keys in every locale pack under website/src/i18n/. Argue from the drawsOn elements above — they are `
99
+ + `website/src/sections/${identity}.sections.tsx and add it to ${websitePageSectionsListName(page.pageRef)} in that file at its reading-order position `
100
+ + '(the section has landed only once it is an entry of that list — a definition nothing lists renders nothing), '
101
+ + 'with its label keys in every locale pack that already exists under website/src/i18n/ — never a pack for a locale the site does not have. '
102
+ + `Argue from the drawsOn elements above — they are `
94
103
  + 'what the plan decided this section says; do not invent claims they do not support.',
95
104
  }];
96
105
  });
@@ -1 +1 @@
1
- {"version":3,"file":"application-build-website-context.companion.service.js","sourceRoot":"","sources":["../../../../../src/meta-workflows/services/application-build-website-context.companion.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,uCAAuC,EACvC,mBAAmB,GACpB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,8BAA8B,EAE9B,wBAAwB,EACxB,uBAAuB,EAEvB,iBAAiB,EACjB,yBAAyB,EACzB,uBAAuB,GACxB,MAAM,oDAAoD,CAAC;AAE5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0DAA0D,CAAC;AAE/F;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,6BAA6B,CAAC,IAAmB,EAAE,gBAAyB;IAC1F,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,uBAAuB,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IACtE,MAAM,IAAI,GAAG,EAAE,SAAS,EAAE,2C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AO,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;oBACnI,CAAC;gBACH,CAAC;YACH,CAAC;YAAC,MAAM,CAAC;gBACP,8FAA8F;YAChG,CAAC;QACH,CAAC;QACD,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC7B,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,CAAC;IAC7E,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import {\n type BuildTaskContextSource,\n decidedFamilyValuesFromCompanionExports,\n indexDecidedAspects,\n} from '@wildo-ai/application-creation-runtime';\nimport {\n ApplicationSpecificationFamily,\n type BuildPlanTask,\n BuildPlanTaskProductKind,\n BuildPlanTaskTargetKind,\n type WebsitePlan,\n WebsitePlanSchema,\n WEBSITE_SECTION_SKILL_REF,\n websiteProductSkillRefs,\n} from '@wildo-ai/saas-specifications/application-creation';\n\nimport { websitePageIdentity } from './application-build-task-coding-policy.companion.service';\n\n/**\n * WHAT A WEBSITE TASK IS BUILDING — its page or section as the website plan decided it.\n *\n * The first journey run that built a website (scratch-journey, 2026-09-23) dispatched only its four\n * PAGE tasks. Each page agent, told only \"author the homepage\", wrote every section of its page\n * itself — so all 24 section tasks read LANDED without running, and none of the nine section skills\n * ever reached a coding agent. The agent had no way to know the sections were someone else's work:\n * the task carried an objective and a product, and the plan that split the page into sections was not\n * in the brief. It also never saw what each section was FOR — the purpose, the audience, the tone of\n * voice and the market entries it argues from — which the plan had decided and the agent re-derived.\n *\n * So a website task is handed its slice of the plan:\n * - a PAGE task gets the page (purpose, audience, tone) and its sections in reading order, each with\n * the skill that authors it, plus the boundary: author the page and register the sections list,\n * never the section bodies;\n * - a SECTION task gets its section (kind, purpose, the market elements it draws on, resolved), the\n * page it sits on and its neighbours, plus the skill its kind names and how it lands.\n *\n * A deterministic derivation from landed families (the push floor of decision #251): nothing here\n * chooses context. `null` for any task that is not a website task.\n */\nexport function buildWebsitePlanContextSource(task: BuildPlanTask, companionExports: unknown): BuildTaskContextSource | null {\n if (task.target.kind !== BuildPlanTaskTargetKind.WEBSITE) return null;\n const base = { sourceRef: 'application-creation:context/website-plan', originRef: 'application-creation:origin/specification-families' };\n const plan = readWebsitePlan(companionExports);\n if (plan === undefined) {\n return {\n ...base,\n content: {\n unanswerable: 'The application has no readable website plan, so nothing says what this page or section should say. '\n + 'Build what the objective asks, and report that the plan is missing.',\n },\n };\n }\n\n const resolve = elementResolver(companionExports);\n const pages = task.produces.flatMap((product): unknown[] => {\n if (product.kind !== BuildPlanTaskProductKind.WEBSITE_PAGE && product.kind !== BuildPlanTaskProductKind.WEBSITE_SECTION) return [];\n const page = plan.pages.find((entry) => entry.pageRef === product.pageRef);\n if (page === undefined) return [{ pageRef: product.pageRef, unresolved: 'The website plan carries no page with this ref.' }];\n const identity = websitePageIdentity(page.pageRef);\n const pageView = {\n pageRef: page.pageRef,\n treeIdentity: identity,\n purpose: page.purpose,\n audience: page.audienceIcpRefs.map(resolve),\n ...(page.toneOfVoiceRef !== undefined ? { toneOfVoice: resolve(page.toneOfVoiceRef) } : {}),\n sectionsInReadingOrder: page.sections.map((section) => ({\n sectionRef: section.sectionRef,\n kind: section.kind,\n purpose: section.purpose,\n authoredWithSkill: WEBSITE_SECTION_SKILL_REF[section.kind],\n })),\n };\n if (product.kind === BuildPlanTaskProductKind.WEBSITE_PAGE) {\n const pageConst = identity.toUpperCase().replace(/[^A-Z0-9]+/g, '_');\n return [{\n page: pageView,\n boundary: `This task authors the PAGE: its route under website/src/pages/, its bridge and page component under `\n + `website/src/pages-impl/ (${identity}.page.tsx, ${identity}.bridge.tsx), its manifest registered in `\n + `WEBSITE_PAGE_MANIFESTS in website/src/website-root.config.ts, the page's navigation entry, and `\n + `website/src/sections/${identity}.sections.tsx exporting ${pageConst}_SECTIONS, the page's sections list in the reading order above. `\n + `Register that list in website/src/sections/index.ts (re-export the file and spread ${pageConst}_SECTIONS into WEBSITE_SECTIONS): `\n + 'the label audit and the manifest\\'s section resolution read WEBSITE_SECTIONS, so an unregistered list is a page whose sections '\n + 'nothing checks. '\n + 'For every locale `wildo.website.config.ts` lists beyond the default, add the route copy under '\n + 'website/src/pages/<locale path>/ and the page\\'s keys in that locale\\'s pack under website/src/i18n/. '\n + 'Each section is its OWN build task, authored with the skill named beside it — do not write section bodies here; '\n + 'leave the list empty for those tasks to fill.',\n }];\n }\n const index = page.sections.findIndex((entry) => entry.sectionRef === product.sectionRef);\n const section = page.sections[index];\n if (section === undefined) return [{ page: pageView, sectionRef: product.sectionRef, unresolved: 'The page carries no section with this ref.' }];\n return [{\n section: {\n sectionRef: section.sectionRef,\n kind: section.kind,\n purpose: section.purpose,\n authoredWithSkill: WEBSITE_SECTION_SKILL_REF[section.kind],\n drawsOn: section.drawsOnRefs.map(resolve),\n position: `${index + 1} of ${page.sections.length} on ${page.pageRef}`,\n },\n page: pageView,\n landing: `Define the section with defineWebsiteSection({ sectionRef: '${section.sectionRef}', … }) in `\n + `website/src/sections/${identity}.sections.tsx and add it to that file's sections list at its reading-order position, `\n + `with its label keys in every locale pack under website/src/i18n/. Argue from the drawsOn elements above — they are `\n + 'what the plan decided this section says; do not invent claims they do not support.',\n }];\n });\n return { ...base, content: { pages } };\n}\n\n/**\n * The skills a website task is authored with: DERIVED from the plan (the page skill for a page, the\n * kind's skill for a section) and placed first, then whatever the decomposer's model declared. The\n * derivation is what the model cannot get wrong; the declared refs are kept because a model may\n * legitimately add one (the label-pack skill, the contact-form skill) that no map would.\n */\nexport function websiteTaskSkillRefs(task: BuildPlanTask, companionExports: unknown): readonly string[] {\n if (task.target.kind !== BuildPlanTaskTargetKind.WEBSITE) return task.skillRefs;\n const plan = readWebsitePlan(companionExports);\n const derived = task.produces.flatMap((product) => {\n if (product.kind === BuildPlanTaskProductKind.WEBSITE_PAGE) return websiteProductSkillRefs({ pageRef: product.pageRef }, plan);\n if (product.kind === BuildPlanTaskProductKind.WEBSITE_SECTION) {\n return websiteProductSkillRefs({ pageRef: product.pageRef, sectionRef: product.sectionRef }, plan);\n }\n return [];\n });\n return [...new Set([...derived, ...task.skillRefs])];\n}\n\n/**\n * The landed website plan, read through the semantic-authority binding — the registry that owns which\n * `companion-exports` field carries each family — rather than a hand-typed field name that could\n * drift from it.\n */\nfunction readWebsitePlan(companionExports: unknown): WebsitePlan | undefined {\n if (companionExports === null || typeof companionExports !== 'object') return undefined;\n const authored = decidedFamilyValuesFromCompanionExports(companionExports as Record<string, unknown>)[ApplicationSpecificationFamily.WEBSITE_PLAN];\n if (authored === undefined || authored === null) return undefined;\n const parsed = WebsitePlanSchema.safeParse(authored);\n return parsed.success ? parsed.data : undefined;\n}\n\n/**\n * A ref → its decided element, across every aspect. `drawsOnRefs` names six market vocabularies at\n * once and is deliberately untyped, so the lookup is by ref alone; a ref that names nothing is\n * returned as `{ ref, unresolved: true }` rather than dropped, so the agent knows the plan cited\n * something the market does not hold instead of concluding the section draws on nothing.\n */\nfunction elementResolver(companionExports: unknown): (ref: string) => unknown {\n let byRef: Map<string, { aspectKey: string; label: string; element: unknown }> | undefined;\n return (ref) => {\n if (byRef === undefined) {\n byRef = new Map();\n try {\n const index = indexDecidedAspects(decidedFamilyValuesFromCompanionExports(companionExports as Record<string, unknown>));\n for (const entry of index.aspects.values()) {\n for (const element of entry.elements) {\n if (!byRef.has(element.ref)) byRef.set(element.ref, { aspectKey: entry.aspectKey, label: element.label, element: element.item });\n }\n }\n } catch {\n // An index that cannot be built leaves every ref unresolved, which the agent is told per ref.\n }\n }\n const found = byRef.get(ref);\n return found === undefined ? { ref, unresolved: true } : { ref, ...found };\n };\n}\n"]}
1
+ {"version":3,"file":"application-build-website-context.companion.service.js","sourceRoot":"","sources":["../../../../../src/meta-workflows/services/application-build-website-context.companion.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,uCAAuC,EACvC,mBAAmB,GACpB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,8BAA8B,EAE9B,wBAAwB,EACxB,uBAAuB,EAEvB,iBAAiB,EACjB,yBAAyB,EACzB,uBAAuB,GACxB,MAAM,oDAAoD,CAAC;AAE5D,OAAO,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,0DAA0D,CAAC;AAE5H;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,6BAA6B,CAAC,IAAmB,EAAE,gBAAyB;IAC1F,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,uBAAuB,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IACtE,MAAM,IAAI,GAAG,EAAE,SAAS,EAAE,2CAA2C,EAAE,SAAS,EAAE,oDAAoD,EAAE,CAAC;IACzI,MAAM,IAAI,GAAG,eAAe,CAAC,gBAAgB,CAAC,CAAC;IAC/C,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO;YACL,GAAG,IAAI;YACP,OAAO,EAAE;gBACP,YAAY,EAAE,sGAAsG;sBAChH,qEAAqE;aAC1E;SACF,CAAC;IACJ,CAAC;IAED,MAAM,OAAO,GAAG,eAAe,CAAC,gBAAgB,CAAC,CAAC;IAClD,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAa,EAAE;QACzD,IAAI,OAAO,CAAC,IAAI,KAAK,wBAAwB,CAAC,YAAY,IAAI,OAAO,CAAC,IAAI,KAAK,wBAAwB,CAAC,eAAe;YAAE,OAAO,EAAE,CAAC;QACnI,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;QA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,CAAC;AACJ,CAAC","sourcesContent":["import {\n type BuildTaskContextSource,\n decidedFamilyValuesFromCompanionExports,\n indexDecidedAspects,\n} from '@wildo-ai/application-creation-runtime';\nimport {\n ApplicationSpecificationFamily,\n type BuildPlanTask,\n BuildPlanTaskProductKind,\n BuildPlanTaskTargetKind,\n type WebsitePlan,\n WebsitePlanSchema,\n WEBSITE_SECTION_SKILL_REF,\n websiteProductSkillRefs,\n} from '@wildo-ai/saas-specifications/application-creation';\n\nimport { websitePageIdentity, websitePageSectionsListName } from './application-build-task-coding-policy.companion.service';\n\n/**\n * WHAT A WEBSITE TASK IS BUILDING — its page or section as the website plan decided it.\n *\n * The first journey run that built a website (scratch-journey, 2026-09-23) dispatched only its four\n * PAGE tasks. Each page agent, told only \"author the homepage\", wrote every section of its page\n * itself — so all 24 section tasks read LANDED without running, and none of the nine section skills\n * ever reached a coding agent. The agent had no way to know the sections were someone else's work:\n * the task carried an objective and a product, and the plan that split the page into sections was not\n * in the brief. It also never saw what each section was FOR — the purpose, the audience, the tone of\n * voice and the market entries it argues from — which the plan had decided and the agent re-derived.\n *\n * So a website task is handed its slice of the plan:\n * - a PAGE task gets the page (purpose, audience, tone) and its sections in reading order, each with\n * the skill that authors it, plus the boundary: author the page and register the sections list,\n * never the section bodies;\n * - a SECTION task gets its section (kind, purpose, the market elements it draws on, resolved), the\n * page it sits on and its neighbours, plus the skill its kind names and how it lands.\n *\n * A deterministic derivation from landed families (the push floor of decision #251): nothing here\n * chooses context. `null` for any task that is not a website task.\n */\nexport function buildWebsitePlanContextSource(task: BuildPlanTask, companionExports: unknown): BuildTaskContextSource | null {\n if (task.target.kind !== BuildPlanTaskTargetKind.WEBSITE) return null;\n const base = { sourceRef: 'application-creation:context/website-plan', originRef: 'application-creation:origin/specification-families' };\n const plan = readWebsitePlan(companionExports);\n if (plan === undefined) {\n return {\n ...base,\n content: {\n unanswerable: 'The application has no readable website plan, so nothing says what this page or section should say. '\n + 'Build what the objective asks, and report that the plan is missing.',\n },\n };\n }\n\n const resolve = elementResolver(companionExports);\n const pages = task.produces.flatMap((product): unknown[] => {\n if (product.kind !== BuildPlanTaskProductKind.WEBSITE_PAGE && product.kind !== BuildPlanTaskProductKind.WEBSITE_SECTION) return [];\n const page = plan.pages.find((entry) => entry.pageRef === product.pageRef);\n if (page === undefined) return [{ pageRef: product.pageRef, unresolved: 'The website plan carries no page with this ref.' }];\n const identity = websitePageIdentity(page.pageRef);\n const pageView = {\n pageRef: page.pageRef,\n treeIdentity: identity,\n purpose: page.purpose,\n audience: page.audienceIcpRefs.map(resolve),\n ...(page.toneOfVoiceRef !== undefined ? { toneOfVoice: resolve(page.toneOfVoiceRef) } : {}),\n sectionsInReadingOrder: page.sections.map((section) => ({\n sectionRef: section.sectionRef,\n kind: section.kind,\n purpose: section.purpose,\n authoredWithSkill: WEBSITE_SECTION_SKILL_REF[section.kind],\n })),\n };\n if (product.kind === BuildPlanTaskProductKind.WEBSITE_PAGE) {\n const listName = websitePageSectionsListName(page.pageRef);\n return [{\n page: pageView,\n boundary: `This task authors the PAGE: its route under website/src/pages/, its bridge and page component under `\n + `website/src/pages-impl/ (${identity}.page.tsx, ${identity}.bridge.tsx), its manifest registered in `\n + `WEBSITE_PAGE_MANIFESTS in website/src/website-root.config.ts, the page's navigation entry, and `\n + `website/src/sections/${identity}.sections.tsx exporting ${listName}, the page's sections list in the reading order above, `\n // #2224: an unannotated EMPTY array is `never[]`, and the page that maps over it does not compile.\n + `declared with its type — \\`export const ${listName}: readonly WebsiteSectionDefinition[] = [];\\` — because it starts empty and `\n + 'an unannotated empty array is never[], which the page cannot map over. '\n // #2205: rendered through the engine component, an empty list shows a marked pending block in dev\n // instead of a blank page; `astro build` refuses a page with no section, so it can never ship empty.\n + `The page component renders that list as <WebsitePageSections pageRef=\"${identity}\" sections={${listName}} /> `\n + '(from @wildo-ai/saas-website), never a hand-written map: while the list is empty it shows the page as pending. '\n + `Register that list in website/src/sections/index.ts (re-export the file and spread ${listName} into WEBSITE_SECTIONS): `\n + 'the label audit and the manifest\\'s section resolution read WEBSITE_SECTIONS, so an unregistered list is a page whose sections '\n + 'nothing checks. '\n + 'For every locale `wildo.website.config.ts` lists beyond the default, add the route copy under '\n + 'website/src/pages/<locale path>/ and the page\\'s keys in that locale\\'s pack under website/src/i18n/. '\n + 'Each section is its OWN build task, authored with the skill named beside it — do not write section bodies here; '\n + 'leave the list empty for those tasks to fill.',\n }];\n }\n const index = page.sections.findIndex((entry) => entry.sectionRef === product.sectionRef);\n const section = page.sections[index];\n if (section === undefined) return [{ page: pageView, sectionRef: product.sectionRef, unresolved: 'The page carries no section with this ref.' }];\n return [{\n section: {\n sectionRef: section.sectionRef,\n kind: section.kind,\n purpose: section.purpose,\n authoredWithSkill: WEBSITE_SECTION_SKILL_REF[section.kind],\n drawsOn: section.drawsOnRefs.map(resolve),\n position: `${index + 1} of ${page.sections.length} on ${page.pageRef}`,\n },\n page: pageView,\n landing: `Define the section with defineWebsiteSection({ sectionRef: '${section.sectionRef}', … }) in `\n + `website/src/sections/${identity}.sections.tsx and add it to ${websitePageSectionsListName(page.pageRef)} in that file at its reading-order position `\n + '(the section has landed only once it is an entry of that list — a definition nothing lists renders nothing), '\n + 'with its label keys in every locale pack that already exists under website/src/i18n/ — never a pack for a locale the site does not have. '\n + `Argue from the drawsOn elements above — they are `\n + 'what the plan decided this section says; do not invent claims they do not support.',\n }];\n });\n return { ...base, content: { pages } };\n}\n\n/**\n * The skills a website task is authored with: DERIVED from the plan (the page skill for a page, the\n * kind's skill for a section) and placed first, then whatever the decomposer's model declared. The\n * derivation is what the model cannot get wrong; the declared refs are kept because a model may\n * legitimately add one (the label-pack skill, the contact-form skill) that no map would.\n */\nexport function websiteTaskSkillRefs(task: BuildPlanTask, companionExports: unknown): readonly string[] {\n if (task.target.kind !== BuildPlanTaskTargetKind.WEBSITE) return task.skillRefs;\n const plan = readWebsitePlan(companionExports);\n const derived = task.produces.flatMap((product) => {\n if (product.kind === BuildPlanTaskProductKind.WEBSITE_PAGE) return websiteProductSkillRefs({ pageRef: product.pageRef }, plan);\n if (product.kind === BuildPlanTaskProductKind.WEBSITE_SECTION) {\n return websiteProductSkillRefs({ pageRef: product.pageRef, sectionRef: product.sectionRef }, plan);\n }\n return [];\n });\n return [...new Set([...derived, ...task.skillRefs])];\n}\n\n/**\n * The landed website plan, read through the semantic-authority binding — the registry that owns which\n * `companion-exports` field carries each family — rather than a hand-typed field name that could\n * drift from it.\n */\nfunction readWebsitePlan(companionExports: unknown): WebsitePlan | undefined {\n if (companionExports === null || typeof companionExports !== 'object') return undefined;\n const authored = decidedFamilyValuesFromCompanionExports(companionExports as Record<string, unknown>)[ApplicationSpecificationFamily.WEBSITE_PLAN];\n if (authored === undefined || authored === null) return undefined;\n const parsed = WebsitePlanSchema.safeParse(authored);\n return parsed.success ? parsed.data : undefined;\n}\n\n/**\n * A ref → its decided element, across every aspect. `drawsOnRefs` names six market vocabularies at\n * once and is deliberately untyped, so the lookup is by ref alone; a ref that names nothing is\n * returned as `{ ref, unresolved: true }` rather than dropped, so the agent knows the plan cited\n * something the market does not hold instead of concluding the section draws on nothing.\n */\nfunction elementResolver(companionExports: unknown): (ref: string) => unknown {\n let byRef: Map<string, { aspectKey: string; label: string; element: unknown }> | undefined;\n return (ref) => {\n if (byRef === undefined) {\n byRef = new Map();\n try {\n const index = indexDecidedAspects(decidedFamilyValuesFromCompanionExports(companionExports as Record<string, unknown>));\n for (const entry of index.aspects.values()) {\n for (const element of entry.elements) {\n if (!byRef.has(element.ref)) byRef.set(element.ref, { aspectKey: entry.aspectKey, label: element.label, element: element.item });\n }\n }\n } catch {\n // An index that cannot be built leaves every ref unresolved, which the agent is told per ref.\n }\n }\n const found = byRef.get(ref);\n return found === undefined ? { ref, unresolved: true } : { ref, ...found };\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"application-maturity-executor.companion.service.d.ts","sourceRoot":"","sources":["../../../../../src/meta-workflows/services/application-maturity-executor.companion.service.ts"],"names":[],"m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.companion.service.d.ts","sourceRoot":"","sources":["../../../../../src/meta-workflows/services/application-maturity-executor.companion.service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAIL,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAChC,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EAML,KAAK,yBAAyB,EAC/B,MAAM,wCAAwC,CAAC;AAGhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAE7E;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,iCAAiC,+BAA+B,CAAC;AAE9E,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,WAAW,EAAE,OAAO,iCAAiC,CAAC;IAC/D,QAAQ,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC;IACvB,yEAAyE;IACzE,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,CAAC;IACvC,sGAAsG;IACtG,QAAQ,CAAC,QAAQ,EAAE,SAAS,0BAA0B,EAAE,CAAC;IACzD,iEAAiE;IACjE,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,uEAAuE;IACvE,QAAQ,CAAC,oBAAoB,EAAE,SAAS,MAAM,EAAE,CAAC;CAClD;AAED,kHAAkH;AAClH,qBAAa,iCAAkC,SAAQ,KAAK;CAAG;AAK/D,qBACa,2CAA2C;IAIjB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACR,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IAJrF,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA+D;gBAGlC,MAAM,EAAE,aAAa,EACN,gBAAgB,EAAE,gBAAgB;IAK1F,OAAO,CAAC,KAAK,EAAE;QAC1B,uFAAuF;QACvF,QAAQ,CAAC,MAAM,EAAE,yBAAyB,CAAC;QAC3C,wCAAwC;QACxC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;KAC3B,GAAG,OAAO,CAAC,kCAAkC,CAAC;CAkDhD"}
@@ -10,12 +10,10 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  var __param = (this && this.__param) || function (paramIndex, decorator) {
11
11
  return function (target, key) { decorator(target, key, paramIndex); }
12
12
  };
13
- import { writeFile } from 'node:fs/promises';
14
- import { join } from 'node:path';
15
13
  import { inject, injectable } from 'inversify';
16
14
  import { SAAS_SERVICE_TYPES } from '@wildo-ai/saas-backend-lib';
17
15
  import { ApplicationSpecificationFamily, ApplicationSpecificationFamilySemanticSchemaRef, validateApplicationMaturity, } from '@wildo-ai/saas-specifications/application-creation';
18
- import { deriveApplicationMaturity, landApplicationSpecificationArtifact, planCompanionExportWiring, resolvePlaybookOutputLandingTarget, } from '@wildo-ai/application-creation-runtime';
16
+ import { deriveApplicationMaturity, landApplicationSpecificationArtifact, applyCompanionExportWiring, planCompanionExportWiring, resolvePlaybookOutputLandingTarget, } from '@wildo-ai/application-creation-runtime';
19
17
  import { COMPANION_SERVICE_TYPES } from '../../core/inject/models/service-types.js';
20
18
  /**
21
19
  * The `bottom_up.maturity-reading` playbook's EXECUTOR — a runner-owned step, like the capability
@@ -64,10 +62,11 @@ let ApplicationMaturityExecutorCompanionService = class ApplicationMaturityExecu
64
62
  constantPrefix: LANDED_CONSTANT_PREFIX,
65
63
  });
66
64
  // Planned against the CURRENT bytes, before the write — an unwirable landing refuses at zero cost.
67
- const wiring = planCompanionExportWiring({
65
+ const wiringRequest = {
68
66
  specificationsPackageRoot,
69
67
  outputs: [{ family: ApplicationSpecificationFamily.APPLICATION_MATURITY, packageRelativePath: target.packageRelativePath, exportedConstantName: target.exportedConstantName }],
70
- });
68
+ };
69
+ const wiring = planCompanionExportWiring(wiringRequest);
71
70
  const landedFile = await landApplicationSpecificationArtifact({
72
71
  specificationsPackageRoot,
73
72
  target,
@@ -75,13 +74,13 @@ let ApplicationMaturityExecutorCompanionService = class ApplicationMaturityExecu
75
74
  ...(input.dryRun === true ? { dryRun: true } : {}),
76
75
  });
77
76
  const landed = [];
77
+ let applied = wiring;
78
78
  if (input.dryRun !== true) {
79
79
  landed.push(landedFile.packageRelativePath);
80
- // LAST: a slot must never point at a file that failed to land.
81
- for (const edit of wiring.edits) {
82
- await writeFile(join(specificationsPackageRoot, edit.packageRelativePath), edit.renderedSource);
83
- landed.push(edit.packageRelativePath);
84
- }
80
+ // LAST: a slot must never point at a file that failed to land. Applied from the files as they are NOW, never
81
+ // from the plan above: another landing may have wired while this one awaited its write (#2249).
82
+ applied = applyCompanionExportWiring(wiringRequest);
83
+ landed.push(...applied.edits.map((edit) => edit.packageRelativePath));
85
84
  }
86
85
  return {
87
86
  playbookRef: APPLICATION_MATURITY_PLAYBOOK_REF,
@@ -89,7 +88,7 @@ let ApplicationMaturityExecutorCompanionService = class ApplicationMaturityExecu
89
88
  maturity,
90
89
  findings,
91
90
  landed,
92
- wiringAlreadyInPlace: wiring.alreadyWired,
91
+ wiringAlreadyInPlace: applied.alreadyWired,
93
92
  };
94
93
  }
95
94
  };
@@ -1 +1 @@
1
- {"version":3,"file":"application-maturity-executor.companion.service.js","sourceRoot":"","sources":["../../../../../src/meta-workflows/services/application-maturity-executor.companion.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,EACL,8BAA8B,EAC9B,+CAA+C,EAC/C,2BAA2B,GAG5B,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EACL,yBAAyB,EACzB,oCAAoC,EACpC,yBAAyB,EACzB,kCAAkC,GAEnC,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;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WAAA,MAAM,CAAC,uBAAuB,CAAC,gBAAgB,CAAC,CAAA;;GALxC,2CAA2C,CAgEvD","sourcesContent":["import { writeFile } from 'node:fs/promises';\nimport { join } from 'node:path';\n\nimport { inject, injectable } from 'inversify';\nimport { SAAS_SERVICE_TYPES } from '@wildo-ai/saas-backend-lib';\nimport type { LoggerService } from '@wildo-ai/saas-backend-lib';\nimport {\n ApplicationSpecificationFamily,\n ApplicationSpecificationFamilySemanticSchemaRef,\n validateApplicationMaturity,\n type ApplicationMaturity,\n type ApplicationMaturityFinding,\n} from '@wildo-ai/saas-specifications/application-creation';\nimport {\n deriveApplicationMaturity,\n landApplicationSpecificationArtifact,\n planCompanionExportWiring,\n resolvePlaybookOutputLandingTarget,\n type ApplicationMaturityInputs,\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';\n\n/**\n * The `bottom_up.maturity-reading` playbook's EXECUTOR — a runner-owned step, like the capability\n * composition's (#1496).\n *\n * The run short-circuits before any brief is composed, and here the reason is stronger than it is\n * for the composition: a model asked where an application stands would ANSWER, and nothing could\n * check the answer. `deriveApplicationMaturity` reads the requirements, the decided-element graph\n * and the build plan's landing probe, so every row names the evidence a reader can go and look at.\n *\n * Nothing here commits, and nothing here refuses. A reading is a working edit until it is committed\n * (`one-source-of-truth.md`) — by a person, or under the autonomy posture by the companion before the\n * next build baseline (#1534) — and it is a MEASUREMENT rather than a gate: there is no \"done\" for\n * an application, so no stage this executor lands may stop anything.\n */\n\nexport const APPLICATION_MATURITY_PLAYBOOK_REF = 'bottom_up.maturity-reading';\n\nexport interface ApplicationMaturityExecutionResult {\n readonly playbookRef: typeof APPLICATION_MATURITY_PLAYBOOK_REF;\n readonly dryRun?: true;\n /** The reading — one row per requirement, and the stage that follows. */\n readonly maturity: ApplicationMaturity;\n /** What the reading says about the application: requirements nobody addressed, proofs nobody took. */\n readonly findings: readonly ApplicationMaturityFinding[];\n /** Package-relative paths this run wrote. Empty on a dry run. */\n readonly landed: readonly string[];\n /** Wiring steps already in place — the idempotent re-land evidence. */\n readonly wiringAlreadyInPlace: readonly string[];\n}\n\n/** The specifications package could not be reached, so nothing could be landed — a host-configuration refusal. */\nexport class ApplicationMaturityExecutionError extends Error {}\n\n/** The constant prefix every landed family constant carries (issue #65: landed constants are app-name-free). */\nconst LANDED_CONSTANT_PREFIX = 'application';\n\n@injectable()\nexport class ApplicationMaturityExecutorCompanionService {\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('ApplicationMaturityExecutorCompanionService');\n }\n\n public async execute(input: {\n /** The landed family VALUES, the landing probe's sets and any runtime observations. */\n readonly inputs: ApplicationMaturityInputs;\n /** Derive and render, write nothing. */\n readonly dryRun?: boolean;\n }): Promise<ApplicationMaturityExecutionResult> {\n const maturity = deriveApplicationMaturity(input.inputs);\n const findings = validateApplicationMaturity(maturity);\n this.logDebug('Application maturity derived', {\n stage: maturity.stage,\n requirements: maturity.requirements.length,\n findings: findings.length,\n });\n\n const specificationsPackageRoot = this.companionContext.resolvedSpecifications?.packageRoot;\n if (!specificationsPackageRoot) {\n throw new ApplicationMaturityExecutionError(\n 'The maturity reading cannot land: this application declares no specifications package in `wildo.saas.config.ts` (`specifications`).',\n );\n }\n const target = resolvePlaybookOutputLandingTarget({\n family: ApplicationSpecificationFamily.APPLICATION_MATURITY,\n schemaRef: ApplicationSpecificationFamilySemanticSchemaRef.APPLICATION_MATURITY,\n constantPrefix: LANDED_CONSTANT_PREFIX,\n });\n // Planned against the CURRENT bytes, before the write — an unwirable landing refuses at zero cost.\n const wiring = planCompanionExportWiring({\n specificationsPackageRoot,\n outputs: [{ family: ApplicationSpecificationFamily.APPLICATION_MATURITY, packageRelativePath: target.packageRelativePath, exportedConstantName: target.exportedConstantName }],\n });\n const landedFile = await landApplicationSpecificationArtifact({\n specificationsPackageRoot,\n target,\n value: maturity,\n ...(input.dryRun === true ? { dryRun: true } : {}),\n });\n const landed: string[] = [];\n if (input.dryRun !== true) {\n landed.push(landedFile.packageRelativePath);\n // LAST: a slot must never point at a file that failed to land.\n for (const edit of wiring.edits) {\n await writeFile(join(specificationsPackageRoot, edit.packageRelativePath), edit.renderedSource);\n landed.push(edit.packageRelativePath);\n }\n }\n return {\n playbookRef: APPLICATION_MATURITY_PLAYBOOK_REF,\n ...(input.dryRun === true ? { dryRun: true as const } : {}),\n maturity,\n findings,\n landed,\n wiringAlreadyInPlace: wiring.alreadyWired,\n };\n }\n}\n"]}
1
+ {"version":3,"file":"application-maturity-executor.companion.service.js","sourceRoot":"","sources":["../../../../../src/meta-workflows/services/application-maturity-executor.companion.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,EACL,8BAA8B,EAC9B,+CAA+C,EAC/C,2BAA2B,GAG5B,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EACL,yBAAyB,EACzB,oCAAoC,EACpC,0BAA0B,EAC1B,yBAAyB,EACzB,kCAAkC,GAEnC,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAGjF;;;;;;;;;;;;;GAaG;AAEH,MAAM,CAAC,MAAM,iCAAiC,GAAG,4BAA4B,CAAC;AAe9E,kHAAkH;AAClH,MAAM,OAAO,iCAAkC,SAAQ,KAAK;CAAG;AAE/D,gHAAgH;AAChH,MAAM,sBAAsB,GAAG,aAAa,CAAC;AAGtC,IAAM,2CAA2C,GAAjD,MAAM,2CAA2C;IAIA;IACe;IAJpD,QAAQ,CAA+D;IAExF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,yBAAyB;YACzB,MAAM;YACN,KAAK,EAAE,QAAQ;YACf,GAAG,CAAC,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACnD,CAAC,CAAC;QACH,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,IAAI,OAAO,GAAG,MAAM,CAAC;QACrB,IAAI,KAAK,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;YAC1B,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC;YAC5C,6GAA6G;YAC7G,gGAAgG;YAChG,OAAO,GAAG,0BAA0B,CAAC,aAAa,CAAC,CAAC;YACpD,MAAM,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC;QACxE,CAAC;QACD,OAAO;YACL,WAAW,EAAE,iCAAiC;YAC9C,GAAG,CAAC,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC3D,QAAQ;YACR,QAAQ;YACR,MAAM;YACN,oBAAoB,EAAE,OAAO,CAAC,YAAY;SAC3C,CAAC;IACJ,CAAC;CACF,CAAA;AAjEY,2CAA2C;IADvD,UAAU,EAAE;IAKR,WAAA,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAA;IACjC,WAAA,MAAM,CAAC,uBAAuB,CAAC,gBAAgB,CAAC,CAAA;;GALxC,2CAA2C,CAiEvD","sourcesContent":["import { inject, injectable } from 'inversify';\nimport { SAAS_SERVICE_TYPES } from '@wildo-ai/saas-backend-lib';\nimport type { LoggerService } from '@wildo-ai/saas-backend-lib';\nimport {\n ApplicationSpecificationFamily,\n ApplicationSpecificationFamilySemanticSchemaRef,\n validateApplicationMaturity,\n type ApplicationMaturity,\n type ApplicationMaturityFinding,\n} from '@wildo-ai/saas-specifications/application-creation';\nimport {\n deriveApplicationMaturity,\n landApplicationSpecificationArtifact,\n applyCompanionExportWiring,\n planCompanionExportWiring,\n resolvePlaybookOutputLandingTarget,\n type ApplicationMaturityInputs,\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';\n\n/**\n * The `bottom_up.maturity-reading` playbook's EXECUTOR — a runner-owned step, like the capability\n * composition's (#1496).\n *\n * The run short-circuits before any brief is composed, and here the reason is stronger than it is\n * for the composition: a model asked where an application stands would ANSWER, and nothing could\n * check the answer. `deriveApplicationMaturity` reads the requirements, the decided-element graph\n * and the build plan's landing probe, so every row names the evidence a reader can go and look at.\n *\n * Nothing here commits, and nothing here refuses. A reading is a working edit until it is committed\n * (`one-source-of-truth.md`) — by a person, or under the autonomy posture by the companion before the\n * next build baseline (#1534) — and it is a MEASUREMENT rather than a gate: there is no \"done\" for\n * an application, so no stage this executor lands may stop anything.\n */\n\nexport const APPLICATION_MATURITY_PLAYBOOK_REF = 'bottom_up.maturity-reading';\n\nexport interface ApplicationMaturityExecutionResult {\n readonly playbookRef: typeof APPLICATION_MATURITY_PLAYBOOK_REF;\n readonly dryRun?: true;\n /** The reading — one row per requirement, and the stage that follows. */\n readonly maturity: ApplicationMaturity;\n /** What the reading says about the application: requirements nobody addressed, proofs nobody took. */\n readonly findings: readonly ApplicationMaturityFinding[];\n /** Package-relative paths this run wrote. Empty on a dry run. */\n readonly landed: readonly string[];\n /** Wiring steps already in place — the idempotent re-land evidence. */\n readonly wiringAlreadyInPlace: readonly string[];\n}\n\n/** The specifications package could not be reached, so nothing could be landed — a host-configuration refusal. */\nexport class ApplicationMaturityExecutionError extends Error {}\n\n/** The constant prefix every landed family constant carries (issue #65: landed constants are app-name-free). */\nconst LANDED_CONSTANT_PREFIX = 'application';\n\n@injectable()\nexport class ApplicationMaturityExecutorCompanionService {\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('ApplicationMaturityExecutorCompanionService');\n }\n\n public async execute(input: {\n /** The landed family VALUES, the landing probe's sets and any runtime observations. */\n readonly inputs: ApplicationMaturityInputs;\n /** Derive and render, write nothing. */\n readonly dryRun?: boolean;\n }): Promise<ApplicationMaturityExecutionResult> {\n const maturity = deriveApplicationMaturity(input.inputs);\n const findings = validateApplicationMaturity(maturity);\n this.logDebug('Application maturity derived', {\n stage: maturity.stage,\n requirements: maturity.requirements.length,\n findings: findings.length,\n });\n\n const specificationsPackageRoot = this.companionContext.resolvedSpecifications?.packageRoot;\n if (!specificationsPackageRoot) {\n throw new ApplicationMaturityExecutionError(\n 'The maturity reading cannot land: this application declares no specifications package in `wildo.saas.config.ts` (`specifications`).',\n );\n }\n const target = resolvePlaybookOutputLandingTarget({\n family: ApplicationSpecificationFamily.APPLICATION_MATURITY,\n schemaRef: ApplicationSpecificationFamilySemanticSchemaRef.APPLICATION_MATURITY,\n constantPrefix: LANDED_CONSTANT_PREFIX,\n });\n // Planned against the CURRENT bytes, before the write — an unwirable landing refuses at zero cost.\n const wiringRequest = {\n specificationsPackageRoot,\n outputs: [{ family: ApplicationSpecificationFamily.APPLICATION_MATURITY, packageRelativePath: target.packageRelativePath, exportedConstantName: target.exportedConstantName }],\n };\n const wiring = planCompanionExportWiring(wiringRequest);\n const landedFile = await landApplicationSpecificationArtifact({\n specificationsPackageRoot,\n target,\n value: maturity,\n ...(input.dryRun === true ? { dryRun: true } : {}),\n });\n const landed: string[] = [];\n let applied = wiring;\n if (input.dryRun !== true) {\n landed.push(landedFile.packageRelativePath);\n // LAST: a slot must never point at a file that failed to land. Applied from the files as they are NOW, never\n // from the plan above: another landing may have wired while this one awaited its write (#2249).\n applied = applyCompanionExportWiring(wiringRequest);\n landed.push(...applied.edits.map((edit) => edit.packageRelativePath));\n }\n return {\n playbookRef: APPLICATION_MATURITY_PLAYBOOK_REF,\n ...(input.dryRun === true ? { dryRun: true as const } : {}),\n maturity,\n findings,\n landed,\n wiringAlreadyInPlace: applied.alreadyWired,\n };\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"capability-composition-executor.companion.service.d.ts","sourceRoot":"","sources":["../../../../../src/meta-workflows/services/capability-composition-executor.companion.service.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEzF,OAAO,EAIL,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC5B,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EAKL,KAAK,2BAA2B,EACjC,MAAM,wCAAwC,CAAC;AAGhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAE7E;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,mCAAmC,qCAAqC,CAAC;AAEtF,MAAM,WAAW,oCAAoC;IACnD,QAAQ,CAAC,WAAW,EAAE,OAAO,mCAAmC,CAAC;IACjE,QAAQ,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC;IACvB,+EAA+E;IAC/E,QAAQ,CAAC,WAAW,EAAE,qBAAqB,CAAC;IAC5C,gHAAgH;IAChH,QAAQ,CAAC,MAAM,EAAE,SAAS,sBAAsB,EAAE,CAAC;IACnD,QAAQ,CAAC,QAAQ,EAAE,SAAS,sBAAsB,EAAE,CAAC;IACrD,QAAQ,CAAC,kBAAkB,EAAE,SAAS,sBAAsB,EAAE,CAAC;IAC/D,oHAAoH;IACpH,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,uEAAuE;IACvE,QAAQ,CAAC,oBAAoB,EAAE,SAAS,MAAM,EAAE,CAAC;CAClD;AAED,wIAAwI;AACxI,qBAAa,mCAAoC,SAAQ,KAAK;CAAG;AAKjE,qBACa,6CAA6C;IAInB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACR,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACtC,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IALhF,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA+D;gBAGlC,MAAM,EAAE,aAAa,EACN,gBAAgB,EAAE,gBAAgB,EACvC,gBAAgB,EAAE,uBAAuB;IAK5F,OAAO,CAAC,KAAK,EAAE;QAC1B,mGAAmG;QACnG,QAAQ,CAAC,MAAM,EAAE,2BAA2B,CAAC;QAC7C,wCAAwC;QACxC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;KAC3B,GAAG,OAAO,CAAC,oCAAoC,CAAC;CAwDlD"}
1
+ {"version":3,"file":"capability-composition-executor.companion.service.d.ts","sourceRoot":"","sources":["../../../../../src/meta-workflows/services/capability-composition-executor.companion.service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEzF,OAAO,EAIL,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC5B,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EAML,KAAK,2BAA2B,EACjC,MAAM,wCAAwC,CAAC;AAGhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAE7E;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,mCAAmC,qCAAqC,CAAC;AAEtF,MAAM,WAAW,oCAAoC;IACnD,QAAQ,CAAC,WAAW,EAAE,OAAO,mCAAmC,CAAC;IACjE,QAAQ,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC;IACvB,+EAA+E;IAC/E,QAAQ,CAAC,WAAW,EAAE,qBAAqB,CAAC;IAC5C,gHAAgH;IAChH,QAAQ,CAAC,MAAM,EAAE,SAAS,sBAAsB,EAAE,CAAC;IACnD,QAAQ,CAAC,QAAQ,EAAE,SAAS,sBAAsB,EAAE,CAAC;IACrD,QAAQ,CAAC,kBAAkB,EAAE,SAAS,sBAAsB,EAAE,CAAC;IAC/D,oHAAoH;IACpH,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,uEAAuE;IACvE,QAAQ,CAAC,oBAAoB,EAAE,SAAS,MAAM,EAAE,CAAC;CAClD;AAED,wIAAwI;AACxI,qBAAa,mCAAoC,SAAQ,KAAK;CAAG;AAKjE,qBACa,6CAA6C;IAInB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACR,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACtC,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IALhF,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA+D;gBAGlC,MAAM,EAAE,aAAa,EACN,gBAAgB,EAAE,gBAAgB,EACvC,gBAAgB,EAAE,uBAAuB;IAK5F,OAAO,CAAC,KAAK,EAAE;QAC1B,mGAAmG;QACnG,QAAQ,CAAC,MAAM,EAAE,2BAA2B,CAAC;QAC7C,wCAAwC;QACxC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;KAC3B,GAAG,OAAO,CAAC,oCAAoC,CAAC;CAyDlD"}
@@ -10,13 +10,11 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  var __param = (this && this.__param) || function (paramIndex, decorator) {
11
11
  return function (target, key) { decorator(target, key, paramIndex); }
12
12
  };
13
- import { writeFile } from 'node:fs/promises';
14
- import { join } from 'node:path';
15
13
  import { inject, injectable } from 'inversify';
16
14
  import { SAAS_SERVICE_TYPES } from '@wildo-ai/saas-backend-lib';
17
15
  import { getCompanionServedLanguages } from '../../core/config/primary-language.companion.utils.js';
18
16
  import { ApplicationSpecificationFamily, ApplicationSpecificationFamilySemanticSchemaRef, CompositionDisposition, } from '@wildo-ai/saas-specifications/application-creation';
19
- import { deriveCapabilityComposition, landApplicationSpecificationArtifact, planCompanionExportWiring, resolvePlaybookOutputLandingTarget, } from '@wildo-ai/application-creation-runtime';
17
+ import { deriveCapabilityComposition, landApplicationSpecificationArtifact, applyCompanionExportWiring, planCompanionExportWiring, resolvePlaybookOutputLandingTarget, } from '@wildo-ai/application-creation-runtime';
20
18
  import { COMPANION_SERVICE_TYPES } from '../../core/inject/models/service-types.js';
21
19
  /**
22
20
  * The `bottom_up.capability-composition` playbook's EXECUTOR — a runner-owned step like the
@@ -69,10 +67,11 @@ let CapabilityCompositionExecutorCompanionService = class CapabilityCompositionE
69
67
  constantPrefix: LANDED_CONSTANT_PREFIX,
70
68
  });
71
69
  // Planned against the CURRENT bytes, before the write — an unwirable landing refuses at zero cost.
72
- const wiring = planCompanionExportWiring({
70
+ const wiringRequest = {
73
71
  specificationsPackageRoot,
74
72
  outputs: [{ family: ApplicationSpecificationFamily.CAPABILITY_COMPOSITION, packageRelativePath: target.packageRelativePath, exportedConstantName: target.exportedConstantName }],
75
- });
73
+ };
74
+ const wiring = planCompanionExportWiring(wiringRequest);
76
75
  const landedFile = await landApplicationSpecificationArtifact({
77
76
  specificationsPackageRoot,
78
77
  target,
@@ -80,13 +79,13 @@ let CapabilityCompositionExecutorCompanionService = class CapabilityCompositionE
80
79
  ...(input.dryRun === true ? { dryRun: true } : {}),
81
80
  });
82
81
  const landed = [];
82
+ let applied = wiring;
83
83
  if (input.dryRun !== true) {
84
84
  landed.push(landedFile.packageRelativePath);
85
- // LAST: a slot must never point at a file that failed to land.
86
- for (const edit of wiring.edits) {
87
- await writeFile(join(specificationsPackageRoot, edit.packageRelativePath), edit.renderedSource);
88
- landed.push(edit.packageRelativePath);
89
- }
85
+ // LAST: a slot must never point at a file that failed to land. Applied from the files as they are NOW, never
86
+ // from the plan above: another landing may have wired while this one awaited its write (#2249).
87
+ applied = applyCompanionExportWiring(wiringRequest);
88
+ landed.push(...applied.edits.map((edit) => edit.packageRelativePath));
90
89
  }
91
90
  return {
92
91
  playbookRef: CAPABILITY_COMPOSITION_PLAYBOOK_REF,
@@ -96,7 +95,7 @@ let CapabilityCompositionExecutorCompanionService = class CapabilityCompositionE
96
95
  declined,
97
96
  ownedByAnotherStep,
98
97
  landed,
99
- wiringAlreadyInPlace: wiring.alreadyWired,
98
+ wiringAlreadyInPlace: applied.alreadyWired,
100
99
  };
101
100
  }
102
101
  };
@@ -1 +1 @@
1
- {"version":3,"file":"capability-composition-executor.companion.service.js","sourceRoot":"","sources":["../../../../../src/meta-workflows/services/capability-composition-executor.companion.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,EAAE,2BAA2B,EAAE,MAAM,oDAAoD,CAAC;AACjG,OAAO,EACL,8BAA8B,EAC9B,+CAA+C,EAC/C,sBAAsB,GAGvB,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EACL,2BAA2B,EAC3B,oCAAoC,EACpC,yBAAyB,EACzB,kCAAkC,GAEnC,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAGjF;;;;;;;;;;;GAWG;AAEH,MAAM,CAAC,MAAM,mCAAmC,GAAG,kCAAkC,CAAC;AAiBtF,wIAAwI;AACxI,MAAM,OAAO,mCAAoC,SAAQ,KAAK;CAAG;AAEjE,gHAAgH;AAChH,MAAM,sBAAsB,GAAG,aAAa,CAAC;AAGtC,IAAM,6CAA6C,GAAnD,MAAM,6CAA6C;IAIF;IACe;IACL;IAL/C,QAAQ,CAA+D;IAExF,YACsD,MAAqB,EACN,gBAAkC,EACvC,gBAAyC;QAFnD,WAAM,GAAN,MAAM,CAAe;QACN,q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,CAAC;YAC3D,WAAW;YACX,MAAM;YACN,QAAQ;YACR,kBAAkB;YAClB,MAAM;YACN,oBAAoB,EAAE,MAAM,CAAC,YAAY;SAC1C,CAAC;IACJ,CAAC;CACF,CAAA;AAxEY,6CAA6C;IADzD,UAAU,EAAE;IAKR,WAAA,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAA;IACjC,WAAA,MAAM,CAAC,uBAAuB,CAAC,gBAAgB,CAAC,CAAA;IAChD,WAAA,MAAM,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAA;;GANnC,6CAA6C,CAwEzD","sourcesContent":["import { writeFile } from 'node:fs/promises';\nimport { join } from 'node:path';\n\nimport { inject, injectable } from 'inversify';\nimport { SAAS_SERVICE_TYPES } from '@wildo-ai/saas-backend-lib';\nimport type { AppConfigurationService, LoggerService } from '@wildo-ai/saas-backend-lib';\nimport { getCompanionServedLanguages } from '../../core/config/primary-language.companion.utils';\nimport {\n ApplicationSpecificationFamily,\n ApplicationSpecificationFamilySemanticSchemaRef,\n CompositionDisposition,\n type CapabilityComposition,\n type CompositionScenarioRef,\n} from '@wildo-ai/saas-specifications/application-creation';\nimport {\n deriveCapabilityComposition,\n landApplicationSpecificationArtifact,\n planCompanionExportWiring,\n resolvePlaybookOutputLandingTarget,\n type CapabilityCompositionInputs,\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';\n\n/**\n * The `bottom_up.capability-composition` playbook's EXECUTOR — a runner-owned step like the\n * foundation's (#1491): the run short-circuits here before any brief is composed, because the\n * composition is a pure function of the definition families and a model asked to produce it would\n * be asked to decide what `deriveCapabilityComposition` already decides.\n *\n * What it does is the same three steps as every deterministic landing (`landCreatorInputAnswer`,\n * the governance facts): plan the companion-exports wiring against the current bytes, land the\n * family through the generic renderer, apply the wiring LAST so a slot never points at a file that\n * failed to land. Nothing here commits — a landed composition is a working edit until a human\n * commits it (`one-source-of-truth.md`, rules 2 and 3).\n */\n\nexport const CAPABILITY_COMPOSITION_PLAYBOOK_REF = 'bottom_up.capability-composition';\n\nexport interface CapabilityCompositionExecutionResult {\n readonly playbookRef: typeof CAPABILITY_COMPOSITION_PLAYBOOK_REF;\n readonly dryRun?: true;\n /** The derived composition — one decision per scenario the framework ships. */\n readonly composition: CapabilityComposition;\n /** The scenarios the foundation will apply, and the two it will not, each with its basis in the composition. */\n readonly needed: readonly CompositionScenarioRef[];\n readonly declined: readonly CompositionScenarioRef[];\n readonly ownedByAnotherStep: readonly CompositionScenarioRef[];\n /** Package-relative paths this run wrote (the family file and any companion-exports wiring). Empty on a dry run. */\n readonly landed: readonly string[];\n /** Wiring steps already in place — the idempotent re-land evidence. */\n readonly wiringAlreadyInPlace: readonly string[];\n}\n\n/** The specifications package could not be reached, so nothing could be landed — a host-configuration refusal, not a derivation one. */\nexport class CapabilityCompositionExecutionError extends Error {}\n\n/** The constant prefix every landed family constant carries (issue #65: landed constants are app-name-free). */\nconst LANDED_CONSTANT_PREFIX = 'application';\n\n@injectable()\nexport class CapabilityCompositionExecutorCompanionService {\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 @inject(SAAS_SERVICE_TYPES.AppConfigService) private readonly appConfigService: AppConfigurationService,\n ) {\n this.logDebug = this.logger.debugByType('CapabilityCompositionExecutorCompanionService');\n }\n\n public async execute(input: {\n /** The landed definition-family VALUES the derivation reads; an absent family is simply absent. */\n readonly inputs: CapabilityCompositionInputs;\n /** Derive and render, write nothing. */\n readonly dryRun?: boolean;\n }): Promise<CapabilityCompositionExecutionResult> {\n // The languages the application serves decide `add-locale`; they are configuration, not a family,\n // so the host reads them here unless the caller already supplied them.\n const composition = deriveCapabilityComposition({\n ...input.inputs,\n servedLanguages: input.inputs.servedLanguages ?? getCompanionServedLanguages(this.appConfigService.config),\n });\n const byDisposition = (disposition: CompositionDisposition): CompositionScenarioRef[] =>\n composition.scenarioDecisions.filter((decision) => decision.disposition === disposition).map((decision) => decision.scenarioRef);\n const needed = byDisposition(CompositionDisposition.NEEDED);\n const declined = byDisposition(CompositionDisposition.DECLINED);\n const ownedByAnotherStep = byDisposition(CompositionDisposition.OWNED_BY_ANOTHER_STEP);\n this.logDebug('Capability composition derived', { needed, declined: declined.length, ownedByAnotherStep: ownedByAnotherStep.length });\n\n const specificationsPackageRoot = this.companionContext.resolvedSpecifications?.packageRoot;\n if (!specificationsPackageRoot) {\n throw new CapabilityCompositionExecutionError(\n 'The capability composition cannot land: this application declares no specifications package in `wildo.saas.config.ts` (`specifications`).',\n );\n }\n const target = resolvePlaybookOutputLandingTarget({\n family: ApplicationSpecificationFamily.CAPABILITY_COMPOSITION,\n schemaRef: ApplicationSpecificationFamilySemanticSchemaRef.CAPABILITY_COMPOSITION,\n constantPrefix: LANDED_CONSTANT_PREFIX,\n });\n // Planned against the CURRENT bytes, before the write — an unwirable landing refuses at zero cost.\n const wiring = planCompanionExportWiring({\n specificationsPackageRoot,\n outputs: [{ family: ApplicationSpecificationFamily.CAPABILITY_COMPOSITION, packageRelativePath: target.packageRelativePath, exportedConstantName: target.exportedConstantName }],\n });\n const landedFile = await landApplicationSpecificationArtifact({\n specificationsPackageRoot,\n target,\n value: composition,\n ...(input.dryRun === true ? { dryRun: true } : {}),\n });\n const landed: string[] = [];\n if (input.dryRun !== true) {\n landed.push(landedFile.packageRelativePath);\n // LAST: a slot must never point at a file that failed to land.\n for (const edit of wiring.edits) {\n await writeFile(join(specificationsPackageRoot, edit.packageRelativePath), edit.renderedSource);\n landed.push(edit.packageRelativePath);\n }\n }\n return {\n playbookRef: CAPABILITY_COMPOSITION_PLAYBOOK_REF,\n ...(input.dryRun === true ? { dryRun: true as const } : {}),\n composition,\n needed,\n declined,\n ownedByAnotherStep,\n landed,\n wiringAlreadyInPlace: wiring.alreadyWired,\n };\n }\n}\n"]}
1
+ {"version":3,"file":"capability-composition-executor.companion.service.js","sourceRoot":"","sources":["../../../../../src/meta-workflows/services/capability-composition-executor.companion.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,EAAE,2BAA2B,EAAE,MAAM,oDAAoD,CAAC;AACjG,OAAO,EACL,8BAA8B,EAC9B,+CAA+C,EAC/C,sBAAsB,GAGvB,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EACL,2BAA2B,EAC3B,oCAAoC,EACpC,0BAA0B,EAC1B,yBAAyB,EACzB,kCAAkC,GAEnC,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAGjF;;;;;;;;;;;GAWG;AAEH,MAAM,CAAC,MAAM,mCAAmC,GAAG,kCAAkC,CAAC;AAiBtF,wIAAwI;AACxI,MAAM,OAAO,mCAAoC,SAAQ,KAAK;CAAG;AAEjE,gHAAgH;AAChH,MAAM,sBAAsB,GAAG,aAAa,CAAC;AAGtC,IAAM,6CAA6C,GAAnD,MAAM,6CAA6C;IAIF;IACe;IACL;IAL/C,QAAQ,CAA+D;IAExF,YACsD,MAAqB,EACN,gBAAkC,EACvC,gBAAyC;QAFnD,WAAM,GAAN,MAAM,CAAe;QACN,qBAAgB,GAAhB,gBAAgB,CAAkB;QACvC,qBAAgB,GAAhB,gBAAgB,CAAyB;QAEvG,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,+CAA+C,CAAC,CAAC;IAC3F,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,KAKpB;QACC,kGAAkG;QAClG,uEAAuE;QACvE,MAAM,WAAW,GAAG,2BAA2B,CAAC;YAC9C,GAAG,KAAK,CA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AAC,gBAAgB,CAAC,CAAA;IAChD,WAAA,MAAM,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAA;;GANnC,6CAA6C,CAyEzD","sourcesContent":["import { inject, injectable } from 'inversify';\nimport { SAAS_SERVICE_TYPES } from '@wildo-ai/saas-backend-lib';\nimport type { AppConfigurationService, LoggerService } from '@wildo-ai/saas-backend-lib';\nimport { getCompanionServedLanguages } from '../../core/config/primary-language.companion.utils';\nimport {\n ApplicationSpecificationFamily,\n ApplicationSpecificationFamilySemanticSchemaRef,\n CompositionDisposition,\n type CapabilityComposition,\n type CompositionScenarioRef,\n} from '@wildo-ai/saas-specifications/application-creation';\nimport {\n deriveCapabilityComposition,\n landApplicationSpecificationArtifact,\n applyCompanionExportWiring,\n planCompanionExportWiring,\n resolvePlaybookOutputLandingTarget,\n type CapabilityCompositionInputs,\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';\n\n/**\n * The `bottom_up.capability-composition` playbook's EXECUTOR — a runner-owned step like the\n * foundation's (#1491): the run short-circuits here before any brief is composed, because the\n * composition is a pure function of the definition families and a model asked to produce it would\n * be asked to decide what `deriveCapabilityComposition` already decides.\n *\n * What it does is the same three steps as every deterministic landing (`landCreatorInputAnswer`,\n * the governance facts): plan the companion-exports wiring against the current bytes, land the\n * family through the generic renderer, apply the wiring LAST so a slot never points at a file that\n * failed to land. Nothing here commits — a landed composition is a working edit until a human\n * commits it (`one-source-of-truth.md`, rules 2 and 3).\n */\n\nexport const CAPABILITY_COMPOSITION_PLAYBOOK_REF = 'bottom_up.capability-composition';\n\nexport interface CapabilityCompositionExecutionResult {\n readonly playbookRef: typeof CAPABILITY_COMPOSITION_PLAYBOOK_REF;\n readonly dryRun?: true;\n /** The derived composition — one decision per scenario the framework ships. */\n readonly composition: CapabilityComposition;\n /** The scenarios the foundation will apply, and the two it will not, each with its basis in the composition. */\n readonly needed: readonly CompositionScenarioRef[];\n readonly declined: readonly CompositionScenarioRef[];\n readonly ownedByAnotherStep: readonly CompositionScenarioRef[];\n /** Package-relative paths this run wrote (the family file and any companion-exports wiring). Empty on a dry run. */\n readonly landed: readonly string[];\n /** Wiring steps already in place — the idempotent re-land evidence. */\n readonly wiringAlreadyInPlace: readonly string[];\n}\n\n/** The specifications package could not be reached, so nothing could be landed — a host-configuration refusal, not a derivation one. */\nexport class CapabilityCompositionExecutionError extends Error {}\n\n/** The constant prefix every landed family constant carries (issue #65: landed constants are app-name-free). */\nconst LANDED_CONSTANT_PREFIX = 'application';\n\n@injectable()\nexport class CapabilityCompositionExecutorCompanionService {\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 @inject(SAAS_SERVICE_TYPES.AppConfigService) private readonly appConfigService: AppConfigurationService,\n ) {\n this.logDebug = this.logger.debugByType('CapabilityCompositionExecutorCompanionService');\n }\n\n public async execute(input: {\n /** The landed definition-family VALUES the derivation reads; an absent family is simply absent. */\n readonly inputs: CapabilityCompositionInputs;\n /** Derive and render, write nothing. */\n readonly dryRun?: boolean;\n }): Promise<CapabilityCompositionExecutionResult> {\n // The languages the application serves decide `add-locale`; they are configuration, not a family,\n // so the host reads them here unless the caller already supplied them.\n const composition = deriveCapabilityComposition({\n ...input.inputs,\n servedLanguages: input.inputs.servedLanguages ?? getCompanionServedLanguages(this.appConfigService.config),\n });\n const byDisposition = (disposition: CompositionDisposition): CompositionScenarioRef[] =>\n composition.scenarioDecisions.filter((decision) => decision.disposition === disposition).map((decision) => decision.scenarioRef);\n const needed = byDisposition(CompositionDisposition.NEEDED);\n const declined = byDisposition(CompositionDisposition.DECLINED);\n const ownedByAnotherStep = byDisposition(CompositionDisposition.OWNED_BY_ANOTHER_STEP);\n this.logDebug('Capability composition derived', { needed, declined: declined.length, ownedByAnotherStep: ownedByAnotherStep.length });\n\n const specificationsPackageRoot = this.companionContext.resolvedSpecifications?.packageRoot;\n if (!specificationsPackageRoot) {\n throw new CapabilityCompositionExecutionError(\n 'The capability composition cannot land: this application declares no specifications package in `wildo.saas.config.ts` (`specifications`).',\n );\n }\n const target = resolvePlaybookOutputLandingTarget({\n family: ApplicationSpecificationFamily.CAPABILITY_COMPOSITION,\n schemaRef: ApplicationSpecificationFamilySemanticSchemaRef.CAPABILITY_COMPOSITION,\n constantPrefix: LANDED_CONSTANT_PREFIX,\n });\n // Planned against the CURRENT bytes, before the write — an unwirable landing refuses at zero cost.\n const wiringRequest = {\n specificationsPackageRoot,\n outputs: [{ family: ApplicationSpecificationFamily.CAPABILITY_COMPOSITION, packageRelativePath: target.packageRelativePath, exportedConstantName: target.exportedConstantName }],\n };\n const wiring = planCompanionExportWiring(wiringRequest);\n const landedFile = await landApplicationSpecificationArtifact({\n specificationsPackageRoot,\n target,\n value: composition,\n ...(input.dryRun === true ? { dryRun: true } : {}),\n });\n const landed: string[] = [];\n let applied = wiring;\n if (input.dryRun !== true) {\n landed.push(landedFile.packageRelativePath);\n // LAST: a slot must never point at a file that failed to land. Applied from the files as they are NOW, never\n // from the plan above: another landing may have wired while this one awaited its write (#2249).\n applied = applyCompanionExportWiring(wiringRequest);\n landed.push(...applied.edits.map((edit) => edit.packageRelativePath));\n }\n return {\n playbookRef: CAPABILITY_COMPOSITION_PLAYBOOK_REF,\n ...(input.dryRun === true ? { dryRun: true as const } : {}),\n composition,\n needed,\n declined,\n ownedByAnotherStep,\n landed,\n wiringAlreadyInPlace: applied.alreadyWired,\n };\n }\n}\n"]}
@@ -0,0 +1,82 @@
1
+ import type { LoggerService } from '@wildo-ai/saas-backend-lib';
2
+ import type { CompanionContext } from '../../core/context/companion-context';
3
+ import { type CodingRunWriteRegisterCompanionService } from '../../claude-cli/services/coding-run-write-register.companion.service';
4
+ import type { PlaybookRunWriteRegisterCompanionService } from './playbook-run-write-register.companion.service';
5
+ import { type CreationBuildAttemptObservation, type CreationIntervention, type CreationInterruptedPlaybookExecution, type CreationRestartRecord } from '../models/creation-intervention.models';
6
+ /** Refused: a reason was stated for an id no current derivation produces, so it would attach to nothing. */
7
+ export declare class CreationInterventionNotFoundError extends Error {
8
+ readonly interventionId: string;
9
+ constructor(interventionId: string);
10
+ }
11
+ /**
12
+ * The companion half of the INTERVENTION LEDGER (#2231). The derivations are in
13
+ * `creation-intervention.models.ts`; this gathers what they read and keeps the two facts no later read can
14
+ * recover — each restart (`recordRestart`, called by the boot) and each reason a person states.
15
+ *
16
+ * Deliberately light: the boot path injects it, so it depends on the two write registers and the context
17
+ * only. The run rows it also needs (build attempts, playbook executions) are handed in by the report.
18
+ *
19
+ * Everything it stores is under `.wildo-saas/state/meta-workflows/interventions/`, throwaway like the rest of
20
+ * that tree: deleting it loses the restarts and the stated reasons, which is time, and nothing the lane
21
+ * reads, because nothing in the lane reads it.
22
+ */
23
+ export declare class CreationInterventionLedgerCompanionService {
24
+ private readonly logger;
25
+ private readonly companionContext;
26
+ private readonly codingRunWrites;
27
+ private readonly playbookRunWrites;
28
+ private readonly logDebug;
29
+ constructor(logger: LoggerService, companionContext: CompanionContext, codingRunWrites: CodingRunWriteRegisterCompanionService, playbookRunWrites: PlaybookRunWriteRegisterCompanionService);
30
+ /**
31
+ * Record a boot that found runs in flight — a restart, as `deriveRestartIntervention` counts it. Called by
32
+ * the boot right after its reconciliation, with what that reconciliation settled. A boot that found
33
+ * nothing writes nothing: an ordinary start is no intervention. Never throws: a boot must not fail on a
34
+ * report (`continuity-drift-and-cas-basis.md`, Rule 3).
35
+ */
36
+ recordRestart(record: CreationRestartRecord): Promise<void>;
37
+ /** Every recorded restart, oldest first. An unreadable record is skipped, as the registers skip theirs. */
38
+ listRestarts(): Promise<readonly CreationRestartRecord[]>;
39
+ /** The reasons people stated, by intervention id. */
40
+ readStatedReasons(): Promise<Readonly<Record<string, {
41
+ readonly reason: string;
42
+ readonly statedAt: string;
43
+ }>>>;
44
+ /**
45
+ * Record why a person intervened — the one thing the ledger asks of anyone. `knownIds` is the current
46
+ * derivation's ids: a reason for an id nothing produces would attach to nothing, so it is refused.
47
+ */
48
+ stateReason(interventionId: string, reason: string, knownIds: ReadonlySet<string>): Promise<{
49
+ readonly interventionId: string;
50
+ readonly statedAt: string;
51
+ }>;
52
+ /**
53
+ * Every intervention of the run, oldest first, with the reasons stated so far — and what could not be
54
+ * checked, said rather than silently left out.
55
+ */
56
+ deriveInterventions(input: {
57
+ readonly buildAttempts: readonly CreationBuildAttemptObservation[];
58
+ /** Every meta-workflows execution the report read, by id: its lane, and its root when it is a composite's child. */
59
+ readonly playbookExecutions: ReadonlyMap<string, CreationInterruptedPlaybookExecution>;
60
+ /** A run is in flight: the working tree then holds writes no record names yet, so uncommitted edits are not judged. */
61
+ readonly runsInFlight: number;
62
+ }): Promise<{
63
+ readonly interventions: readonly CreationIntervention[];
64
+ readonly notChecked: readonly string[];
65
+ }>;
66
+ /** What each recorded run wrote: coding runs from their change-set register, playbook runs from theirs. */
67
+ private readFootprints;
68
+ /**
69
+ * Every non-merge commit since the first recorded run, each with the bytes of the run-owned paths it
70
+ * touched. Only those paths are hashed: a commit of nothing a run wrote is a person's own work beside the
71
+ * lane, and `classifyCommitAsIntervention` would discard it anyway.
72
+ */
73
+ private deriveCommitInterventions;
74
+ /** Dirty run-owned files whose bytes are neither the run's nor HEAD's. */
75
+ private deriveWorkingTreeEdits;
76
+ private gitBlob;
77
+ private git;
78
+ private interventionsDirectory;
79
+ private restartsDirectory;
80
+ private reasonsPath;
81
+ }
82
+ //# sourceMappingURL=creation-intervention-ledger.companion.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"creation-intervention-ledger.companion.service.d.ts","sourceRoot":"","sources":["../../../../../src/meta-workflows/services/creation-intervention-ledger.companion.service.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAIhE,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