@wildo-ai/dev-companion 1.1.1 → 1.1.3

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 (212) hide show
  1. package/dist/esm/.tsbuildinfo +1 -1
  2. package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts +12 -1
  3. package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts.map +1 -1
  4. package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js +11 -0
  5. package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js.map +1 -1
  6. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.d.ts +153 -1
  7. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.d.ts.map +1 -1
  8. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js +408 -38
  9. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js.map +1 -1
  10. package/dist/esm/claude-cli/services/research-agent-dispatch.companion.service.d.ts +25 -10
  11. package/dist/esm/claude-cli/services/research-agent-dispatch.companion.service.d.ts.map +1 -1
  12. package/dist/esm/claude-cli/services/research-agent-dispatch.companion.service.js +65 -24
  13. package/dist/esm/claude-cli/services/research-agent-dispatch.companion.service.js.map +1 -1
  14. package/dist/esm/claude-cli/services/research-evidence-store.companion.d.ts +70 -0
  15. package/dist/esm/claude-cli/services/research-evidence-store.companion.d.ts.map +1 -0
  16. package/dist/esm/claude-cli/services/research-evidence-store.companion.js +110 -0
  17. package/dist/esm/claude-cli/services/research-evidence-store.companion.js.map +1 -0
  18. package/dist/esm/companion-api/companion-api.schemas.d.ts +59 -2
  19. package/dist/esm/companion-api/companion-api.schemas.d.ts.map +1 -1
  20. package/dist/esm/companion-api/companion-api.schemas.js +60 -0
  21. package/dist/esm/companion-api/companion-api.schemas.js.map +1 -1
  22. package/dist/esm/companion-api/controllers/companion.controller.d.ts +62 -1
  23. package/dist/esm/companion-api/controllers/companion.controller.d.ts.map +1 -1
  24. package/dist/esm/companion-api/controllers/companion.controller.js +295 -19
  25. package/dist/esm/companion-api/controllers/companion.controller.js.map +1 -1
  26. package/dist/esm/core/inject/models/container.d.ts.map +1 -1
  27. package/dist/esm/core/inject/models/container.js +11 -0
  28. package/dist/esm/core/inject/models/container.js.map +1 -1
  29. package/dist/esm/core/inject/models/service-types.d.ts +5 -0
  30. package/dist/esm/core/inject/models/service-types.d.ts.map +1 -1
  31. package/dist/esm/core/inject/models/service-types.js +5 -0
  32. package/dist/esm/core/inject/models/service-types.js.map +1 -1
  33. package/dist/esm/core/introspection/behaviors/companion-introspection-behavior-definitions.d.ts.map +1 -1
  34. package/dist/esm/core/introspection/behaviors/companion-introspection-behavior-definitions.js +81 -0
  35. package/dist/esm/core/introspection/behaviors/companion-introspection-behavior-definitions.js.map +1 -1
  36. package/dist/esm/core/introspection/models/companion-introspection.models.d.ts +11 -1
  37. package/dist/esm/core/introspection/models/companion-introspection.models.d.ts.map +1 -1
  38. package/dist/esm/core/introspection/models/companion-introspection.models.js +39 -0
  39. package/dist/esm/core/introspection/models/companion-introspection.models.js.map +1 -1
  40. package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.d.ts +8 -0
  41. package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.d.ts.map +1 -0
  42. package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.js +317 -0
  43. package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.js.map +1 -0
  44. package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.d.ts +45 -0
  45. package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.d.ts.map +1 -0
  46. package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.js +243 -0
  47. package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.js.map +1 -0
  48. package/dist/esm/core/introspection/resources/introspection-resource-notifier.companion.service.d.ts +123 -0
  49. package/dist/esm/core/introspection/resources/introspection-resource-notifier.companion.service.d.ts.map +1 -0
  50. package/dist/esm/core/introspection/resources/introspection-resource-notifier.companion.service.js +298 -0
  51. package/dist/esm/core/introspection/resources/introspection-resource-notifier.companion.service.js.map +1 -0
  52. package/dist/esm/core/introspection/resources/introspection-resource-source.companion.service.d.ts +78 -1
  53. package/dist/esm/core/introspection/resources/introspection-resource-source.companion.service.d.ts.map +1 -1
  54. package/dist/esm/core/introspection/resources/introspection-resource-source.companion.service.js +155 -6
  55. package/dist/esm/core/introspection/resources/introspection-resource-source.companion.service.js.map +1 -1
  56. package/dist/esm/core/introspection/services/companion-introspection.companion.service.d.ts +131 -2
  57. package/dist/esm/core/introspection/services/companion-introspection.companion.service.d.ts.map +1 -1
  58. package/dist/esm/core/introspection/services/companion-introspection.companion.service.js +259 -9
  59. package/dist/esm/core/introspection/services/companion-introspection.companion.service.js.map +1 -1
  60. package/dist/esm/core/introspection/services/introspection-derivation-state.companion.service.d.ts +243 -0
  61. package/dist/esm/core/introspection/services/introspection-derivation-state.companion.service.d.ts.map +1 -0
  62. package/dist/esm/core/introspection/services/introspection-derivation-state.companion.service.js +417 -0
  63. package/dist/esm/core/introspection/services/introspection-derivation-state.companion.service.js.map +1 -0
  64. package/dist/esm/core/introspection/services/introspection-source-state.companion.service.d.ts +186 -0
  65. package/dist/esm/core/introspection/services/introspection-source-state.companion.service.d.ts.map +1 -0
  66. package/dist/esm/core/introspection/services/introspection-source-state.companion.service.js +368 -0
  67. package/dist/esm/core/introspection/services/introspection-source-state.companion.service.js.map +1 -0
  68. package/dist/esm/core/introspection/services/introspection-source-watcher.companion.service.d.ts +101 -0
  69. package/dist/esm/core/introspection/services/introspection-source-watcher.companion.service.d.ts.map +1 -0
  70. package/dist/esm/core/introspection/services/introspection-source-watcher.companion.service.js +278 -0
  71. package/dist/esm/core/introspection/services/introspection-source-watcher.companion.service.js.map +1 -0
  72. package/dist/esm/core/introspection/subprocess/application-domain-model.behavior.d.ts +370 -0
  73. package/dist/esm/core/introspection/subprocess/application-domain-model.behavior.d.ts.map +1 -0
  74. package/dist/esm/core/introspection/subprocess/application-domain-model.behavior.js +167 -0
  75. package/dist/esm/core/introspection/subprocess/application-domain-model.behavior.js.map +1 -0
  76. package/dist/esm/core/introspection/subprocess/companion-introspection-behavior-handlers.d.ts.map +1 -1
  77. package/dist/esm/core/introspection/subprocess/companion-introspection-behavior-handlers.js +332 -3
  78. package/dist/esm/core/introspection/subprocess/companion-introspection-behavior-handlers.js.map +1 -1
  79. package/dist/esm/core/introspection/subprocess/family-aspects.behavior.d.ts +40 -0
  80. package/dist/esm/core/introspection/subprocess/family-aspects.behavior.d.ts.map +1 -0
  81. package/dist/esm/core/introspection/subprocess/family-aspects.behavior.js +126 -0
  82. package/dist/esm/core/introspection/subprocess/family-aspects.behavior.js.map +1 -0
  83. package/dist/esm/core/introspection/subprocess/specification-artifacts.behavior.d.ts +51 -0
  84. package/dist/esm/core/introspection/subprocess/specification-artifacts.behavior.d.ts.map +1 -0
  85. package/dist/esm/core/introspection/subprocess/specification-artifacts.behavior.js +391 -0
  86. package/dist/esm/core/introspection/subprocess/specification-artifacts.behavior.js.map +1 -0
  87. package/dist/esm/core/runtime/dev-compile-quiet.companion.d.ts +103 -0
  88. package/dist/esm/core/runtime/dev-compile-quiet.companion.d.ts.map +1 -0
  89. package/dist/esm/core/runtime/dev-compile-quiet.companion.js +124 -0
  90. package/dist/esm/core/runtime/dev-compile-quiet.companion.js.map +1 -0
  91. package/dist/esm/core/runtime/services/start-companion-application.service.d.ts +39 -2
  92. package/dist/esm/core/runtime/services/start-companion-application.service.d.ts.map +1 -1
  93. package/dist/esm/core/runtime/services/start-companion-application.service.js +122 -11
  94. package/dist/esm/core/runtime/services/start-companion-application.service.js.map +1 -1
  95. package/dist/esm/core/specifications/non-composite-view-specification-context.shared.d.ts +6 -0
  96. package/dist/esm/core/specifications/non-composite-view-specification-context.shared.d.ts.map +1 -1
  97. package/dist/esm/core/specifications/non-composite-view-specification-context.shared.js.map +1 -1
  98. package/dist/esm/core/specifications/specification-context-factory.shared.d.ts +23 -0
  99. package/dist/esm/core/specifications/specification-context-factory.shared.d.ts.map +1 -1
  100. package/dist/esm/core/specifications/specification-context-factory.shared.js +26 -4
  101. package/dist/esm/core/specifications/specification-context-factory.shared.js.map +1 -1
  102. package/dist/esm/executions/services/companion-executions.companion.service.d.ts.map +1 -1
  103. package/dist/esm/executions/services/companion-executions.companion.service.js +13 -8
  104. package/dist/esm/executions/services/companion-executions.companion.service.js.map +1 -1
  105. package/dist/esm/i18n/components/APP_LAYOUTS_MAIN_CONTAINER.en.d.ts +12 -0
  106. package/dist/esm/i18n/components/APP_LAYOUTS_MAIN_CONTAINER.en.d.ts.map +1 -0
  107. package/dist/esm/i18n/components/APP_LAYOUTS_MAIN_CONTAINER.en.js +12 -0
  108. package/dist/esm/i18n/components/APP_LAYOUTS_MAIN_CONTAINER.en.js.map +1 -0
  109. package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD.en.d.ts +1 -1
  110. package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD.en.js +1 -1
  111. package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD.en.js.map +1 -1
  112. package/dist/esm/i18n/composite_views/app.creation-board.en.d.ts +13 -0
  113. package/dist/esm/i18n/composite_views/app.creation-board.en.d.ts.map +1 -0
  114. package/dist/esm/i18n/composite_views/app.creation-board.en.js +91 -0
  115. package/dist/esm/i18n/composite_views/app.creation-board.en.js.map +1 -0
  116. package/dist/esm/i18n/composite_views/app.domain-model.en.d.ts +38 -0
  117. package/dist/esm/i18n/composite_views/app.domain-model.en.d.ts.map +1 -0
  118. package/dist/esm/i18n/composite_views/app.domain-model.en.js +41 -0
  119. package/dist/esm/i18n/composite_views/app.domain-model.en.js.map +1 -0
  120. package/dist/esm/i18n/index.d.ts +3 -3
  121. package/dist/esm/i18n/index.js +3 -3
  122. package/dist/esm/i18n/index.js.map +1 -1
  123. package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.en.d.ts +24 -0
  124. package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.en.d.ts.map +1 -0
  125. package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.en.js +20 -0
  126. package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.en.js.map +1 -0
  127. package/dist/esm/i18n/resources/wildoApplicationActorTasks.en.d.ts +31 -0
  128. package/dist/esm/i18n/resources/wildoApplicationActorTasks.en.d.ts.map +1 -0
  129. package/dist/esm/i18n/resources/wildoApplicationActorTasks.en.js +27 -0
  130. package/dist/esm/i18n/resources/wildoApplicationActorTasks.en.js.map +1 -0
  131. package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.en.d.ts +24 -0
  132. package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.en.d.ts.map +1 -0
  133. package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.en.js +20 -0
  134. package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.en.js.map +1 -0
  135. package/dist/esm/i18n/resources/workbenchBuildPlanTasks.en.d.ts +28 -0
  136. package/dist/esm/i18n/resources/workbenchBuildPlanTasks.en.d.ts.map +1 -0
  137. package/dist/esm/i18n/resources/workbenchBuildPlanTasks.en.js +24 -0
  138. package/dist/esm/i18n/resources/workbenchBuildPlanTasks.en.js.map +1 -0
  139. package/dist/esm/i18n/resources/workbenchDomainResources.en.d.ts +138 -0
  140. package/dist/esm/i18n/resources/workbenchDomainResources.en.d.ts.map +1 -0
  141. package/dist/esm/i18n/resources/workbenchDomainResources.en.js +100 -0
  142. package/dist/esm/i18n/resources/workbenchDomainResources.en.js.map +1 -0
  143. package/dist/esm/i18n/resources/workbenchPlaybooks.en.d.ts +29 -0
  144. package/dist/esm/i18n/resources/workbenchPlaybooks.en.d.ts.map +1 -0
  145. package/dist/esm/i18n/resources/workbenchPlaybooks.en.js +25 -0
  146. package/dist/esm/i18n/resources/workbenchPlaybooks.en.js.map +1 -0
  147. package/dist/esm/i18n/resources/workbenchRunWriteRecords.en.d.ts +27 -0
  148. package/dist/esm/i18n/resources/workbenchRunWriteRecords.en.d.ts.map +1 -0
  149. package/dist/esm/i18n/resources/workbenchRunWriteRecords.en.js +23 -0
  150. package/dist/esm/i18n/resources/workbenchRunWriteRecords.en.js.map +1 -0
  151. package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts +806 -0
  152. package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts.map +1 -0
  153. package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.js +326 -0
  154. package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.js.map +1 -0
  155. package/dist/esm/i18n/resources/workbenchTraceSessions.en.d.ts +26 -0
  156. package/dist/esm/i18n/resources/workbenchTraceSessions.en.d.ts.map +1 -0
  157. package/dist/esm/i18n/resources/workbenchTraceSessions.en.js +22 -0
  158. package/dist/esm/i18n/resources/workbenchTraceSessions.en.js.map +1 -0
  159. package/dist/esm/i18n/system_enums/market.en.d.ts +202 -0
  160. package/dist/esm/i18n/system_enums/market.en.d.ts.map +1 -0
  161. package/dist/esm/i18n/system_enums/market.en.js +209 -0
  162. package/dist/esm/i18n/system_enums/market.en.js.map +1 -0
  163. package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.d.ts +31 -0
  164. package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.d.ts.map +1 -1
  165. package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.js +91 -8
  166. package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.js.map +1 -1
  167. package/dist/esm/meta-workflows/models/application-research-agent.actors-system.definitions.d.ts +4 -2
  168. package/dist/esm/meta-workflows/models/application-research-agent.actors-system.definitions.d.ts.map +1 -1
  169. package/dist/esm/meta-workflows/models/application-research-agent.actors-system.definitions.js +10 -7
  170. package/dist/esm/meta-workflows/models/application-research-agent.actors-system.definitions.js.map +1 -1
  171. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts +80 -7
  172. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts.map +1 -1
  173. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js +261 -24
  174. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js.map +1 -1
  175. package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.d.ts +46 -3
  176. package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.d.ts.map +1 -1
  177. package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.js +95 -2
  178. package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.js.map +1 -1
  179. package/dist/esm/meta-workflows/services/execution-trace-read.companion.service.d.ts +9 -0
  180. package/dist/esm/meta-workflows/services/execution-trace-read.companion.service.d.ts.map +1 -1
  181. package/dist/esm/meta-workflows/services/execution-trace-read.companion.service.js +13 -0
  182. package/dist/esm/meta-workflows/services/execution-trace-read.companion.service.js.map +1 -1
  183. package/dist/esm/meta-workflows/services/playbook-run-write-register.companion.service.d.ts +12 -0
  184. package/dist/esm/meta-workflows/services/playbook-run-write-register.companion.service.d.ts.map +1 -1
  185. package/dist/esm/meta-workflows/services/playbook-run-write-register.companion.service.js +23 -0
  186. package/dist/esm/meta-workflows/services/playbook-run-write-register.companion.service.js.map +1 -1
  187. package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts +113 -1
  188. package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts.map +1 -1
  189. package/dist/esm/meta-workflows/services/playbook-run.companion.service.js +517 -54
  190. package/dist/esm/meta-workflows/services/playbook-run.companion.service.js.map +1 -1
  191. package/dist/esm/meta-workflows/services/playbook-suspended-run.companion.service.d.ts +40 -0
  192. package/dist/esm/meta-workflows/services/playbook-suspended-run.companion.service.d.ts.map +1 -1
  193. package/dist/esm/meta-workflows/services/playbook-suspended-run.companion.service.js +63 -1
  194. package/dist/esm/meta-workflows/services/playbook-suspended-run.companion.service.js.map +1 -1
  195. package/dist/esm/technical-doc/services/technical-doc.companion.service.d.ts +21 -0
  196. package/dist/esm/technical-doc/services/technical-doc.companion.service.d.ts.map +1 -1
  197. package/dist/esm/technical-doc/services/technical-doc.companion.service.js +84 -2
  198. package/dist/esm/technical-doc/services/technical-doc.companion.service.js.map +1 -1
  199. package/dist/esm/technical-doc/services/technical-documentation-application-derivation.companion.service.d.ts +10 -1
  200. package/dist/esm/technical-doc/services/technical-documentation-application-derivation.companion.service.d.ts.map +1 -1
  201. package/dist/esm/technical-doc/services/technical-documentation-application-derivation.companion.service.js +10 -1
  202. package/dist/esm/technical-doc/services/technical-documentation-application-derivation.companion.service.js.map +1 -1
  203. package/package.json +17 -17
  204. package/dist/esm/.builder.pid +0 -9
  205. package/dist/esm/i18n/resources/workbenchApplicationModules.en.d.ts +0 -36
  206. package/dist/esm/i18n/resources/workbenchApplicationModules.en.d.ts.map +0 -1
  207. package/dist/esm/i18n/resources/workbenchApplicationModules.en.js +0 -32
  208. package/dist/esm/i18n/resources/workbenchApplicationModules.en.js.map +0 -1
  209. package/dist/esm/i18n/resources/workbenchResourceRelationships.en.d.ts +0 -29
  210. package/dist/esm/i18n/resources/workbenchResourceRelationships.en.d.ts.map +0 -1
  211. package/dist/esm/i18n/resources/workbenchResourceRelationships.en.js +0 -25
  212. package/dist/esm/i18n/resources/workbenchResourceRelationships.en.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"non-composite-view-specification-context.shared.js","sourceRoot":"","sources":["../../../../../src/core/specifications/non-composite-view-specification-context.shared.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,wCAAwC,CAAC;AA2ChD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,kCAAkC,CAChD,SAAgG;IAEhG,OAAO,mBAAmB,CACxB,MAAM,CAAC,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE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context-factory.shared';\n\nexport interface NonCompositeViewContextModel {\n title: string;\n purpose: string;\n uiRole: string;\n useWhen?: string;\n avoidWhen?: string;\n textSlotLines?: Array<{ text: string }>;\n implementationReferences?: Array<{ text: string }>;\n notes?: Array<{ text: string }>;\n businessConstraints?: Array<{ text: string }>;\n}\n\ninterface NonCompositeViewCodeHandling {\n definitionOwner?: {\n ownerId: string;\n ownerKind: string;\n notes?: string[];\n };\n viewComponentSymbol?: {\n packageName: string;\n exportName: string;\n importPath?: string;\n };\n declarationSymbols?: Array<{\n packageName: string;\n exportName: string;\n importPath?: string;\n }>;\n notes?: string[];\n}\n\nexport interface NonCompositeViewSpecificationLike {\n purpose: string;\n uiRole: string;\n useWhen?: string;\n avoidWhen?: string;\n textSlots?: Record<string, { purpose: string; whenToUse?: string; notes?: string[] }>;\n businessConstraints?: string[];\n codeHandling?: NonCompositeViewCodeHandling;\n}\n\n/**\n * Render every authored text slot for the four non-composite view families\n * (full-custom, flows-actors, chart, execution) as a header line per slot\n * followed by one bullet per authored note.\n *\n * **Companion-bullet contract.** `TranslationSlotSpecification.notes`\n * (`engine/saas-specifications/src/_core/translation-slot-specification.schemas.ts`)\n * documents that every entry must surface as a dedicated bullet so\n * downstream tooling can grep `${owner} ${slotName} note:` and find every\n * authored entry as its own structural line. The schema-side validators\n * (`assertOptionalNonEmptyStringList` and the per-family twins) reject\n * empty entries on that exact promise. The earlier inline `Notes: ${notes\n * .join(' ')}` flatten silently merged authored entries onto the slot's\n * header line and broke that contract — the symmetric fix already lives\n * in the resource renderer's `buildTextSlotLines`\n * (`resource-specification-context.factory.ts:872-883`); this helper now\n * mirrors that exact shape across the four non-composite view families.\n */\nexport function buildNonCompositeViewTextSlotLines(\n textSlots: Record<string, { purpose: string; whenToUse?: string; notes?: string[] }> | undefined,\n): Array<{ text: string }> | undefined {\n return toMarkdownListItems(\n Object.entries(textSlots ?? {}).flatMap(([slotName, slotSpec]) => {\n const header = `view ${slotName}: ${slotSpec.purpose}${slotSpec.whenToUse ? ` Use when ${slotSpec.whenToUse}.` : ''}`;\n const noteLines = (slotSpec.notes ?? []).map(\n (note) => `view ${slotName} note: ${note}`,\n );\n return [header, ...noteLines];\n }),\n );\n}\n\nexport function buildNonCompositeViewImplementationReferences(\n codeHandling: NonCompositeViewCodeHandling | undefined,\n options: { includeNotes?: boolean } = {},\n): Array<{ text: string }> | undefined {\n if (!codeHandling) {\n return undefined;\n }\n\n return toMarkdownListItems([\n ...(codeHandling.definitionOwner\n ? formatOwnerRefBullets(codeHandling.definitionOwner)\n : []),\n codeHandling.viewComponentSymbol\n ? `View component: ${formatCodeSymbolRef(codeHandling.viewComponentSymbol)}`\n : undefined,\n ...(codeHandling.declarationSymbols ?? []).map((symbol) => (\n `Declaration symbol: ${formatCodeSymbolRef(symbol)}`\n )),\n ...(options.includeNotes ? (codeHandling.notes ?? []) : []),\n ]);\n}\n"]}
1
+ {"version":3,"file":"non-composite-view-specification-context.shared.js","sourceRoot":"","sources":["../../../../../src/core/specifications/non-composite-view-specification-context.shared.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,wCAAwC,CAAC;AAiDhD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,kCAAkC,CAChD,SAAgG;IAEhG,OAAO,mBAAmB,CACxB,MAAM,CAAC,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,EAAE;QAC/D,MAAM,MAAM,GAAG,QAAQ,QAAQ,KAAK,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,QAAQ,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QACtH,MAAM,SAAS,GAAG,CAAC,QAAQ,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CAC1C,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,QAAQ,UAAU,IAAI,EAAE,CAC3C,CAAC;QACF,OAAO,CAAC,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC;IAChC,CAAC,CAAC,CACH,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,6CAA6C,CAC3D,YAAsD,EACtD,UAAsC,EAAE;IAExC,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,mBAAmB,CAAC;QACzB,GAAG,CAAC,YAAY,CAAC,eAAe;YAC9B,CAAC,CAAC,qBAAqB,CAAC,YAAY,CAAC,eAAe,CAAC;YACrD,CAAC,CAAC,EAAE,CAAC;QACP,YAAY,CAAC,mBAAmB;YAC9B,CAAC,CAAC,mBAAmB,mBAAmB,CAAC,YAAY,CAAC,mBAAmB,CAAC,EAAE;YAC5E,CAAC,CAAC,SAAS;QACb,GAAG,CAAC,YAAY,CAAC,kBAAkB,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACzD,uBAAuB,mBAAmB,CAAC,MAAM,CAAC,EAAE,CACrD,CAAC;QACF,GAAG,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KAC5D,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {\n formatCodeSymbolRef,\n formatOwnerRefBullets,\n toMarkdownListItems,\n} from './specification-context-factory.shared';\n\nexport interface NonCompositeViewContextModel {\n title: string;\n purpose: string;\n uiRole: string;\n useWhen?: string;\n avoidWhen?: string;\n textSlotLines?: Array<{ text: string }>;\n implementationReferences?: Array<{ text: string }>;\n notes?: Array<{ text: string }>;\n businessConstraints?: Array<{ text: string }>;\n}\n\ninterface NonCompositeViewCodeHandling {\n definitionOwner?: {\n ownerId: string;\n ownerKind: string;\n notes?: string[];\n };\n viewComponentSymbol?: {\n packageName: string;\n exportName: string;\n /** Public subpath only — see `CodeSymbolRef` (#150). */\n importPath?: string;\n /** Module location; rendered as a location, never as an import target (#150). */\n filePathHint?: string;\n };\n declarationSymbols?: Array<{\n packageName: string;\n exportName: string;\n /** Public subpath only — see `CodeSymbolRef` (#150). */\n importPath?: string;\n /** Module location; rendered as a location, never as an import target (#150). */\n filePathHint?: string;\n }>;\n notes?: string[];\n}\n\nexport interface NonCompositeViewSpecificationLike {\n purpose: string;\n uiRole: string;\n useWhen?: string;\n avoidWhen?: string;\n textSlots?: Record<string, { purpose: string; whenToUse?: string; notes?: string[] }>;\n businessConstraints?: string[];\n codeHandling?: NonCompositeViewCodeHandling;\n}\n\n/**\n * Render every authored text slot for the four non-composite view families\n * (full-custom, flows-actors, chart, execution) as a header line per slot\n * followed by one bullet per authored note.\n *\n * **Companion-bullet contract.** `TranslationSlotSpecification.notes`\n * (`engine/saas-specifications/src/_core/translation-slot-specification.schemas.ts`)\n * documents that every entry must surface as a dedicated bullet so\n * downstream tooling can grep `${owner} ${slotName} note:` and find every\n * authored entry as its own structural line. The schema-side validators\n * (`assertOptionalNonEmptyStringList` and the per-family twins) reject\n * empty entries on that exact promise. The earlier inline `Notes: ${notes\n * .join(' ')}` flatten silently merged authored entries onto the slot's\n * header line and broke that contract — the symmetric fix already lives\n * in the resource renderer's `buildTextSlotLines`\n * (`resource-specification-context.factory.ts:872-883`); this helper now\n * mirrors that exact shape across the four non-composite view families.\n */\nexport function buildNonCompositeViewTextSlotLines(\n textSlots: Record<string, { purpose: string; whenToUse?: string; notes?: string[] }> | undefined,\n): Array<{ text: string }> | undefined {\n return toMarkdownListItems(\n Object.entries(textSlots ?? {}).flatMap(([slotName, slotSpec]) => {\n const header = `view ${slotName}: ${slotSpec.purpose}${slotSpec.whenToUse ? ` Use when ${slotSpec.whenToUse}.` : ''}`;\n const noteLines = (slotSpec.notes ?? []).map(\n (note) => `view ${slotName} note: ${note}`,\n );\n return [header, ...noteLines];\n }),\n );\n}\n\nexport function buildNonCompositeViewImplementationReferences(\n codeHandling: NonCompositeViewCodeHandling | undefined,\n options: { includeNotes?: boolean } = {},\n): Array<{ text: string }> | undefined {\n if (!codeHandling) {\n return undefined;\n }\n\n return toMarkdownListItems([\n ...(codeHandling.definitionOwner\n ? formatOwnerRefBullets(codeHandling.definitionOwner)\n : []),\n codeHandling.viewComponentSymbol\n ? `View component: ${formatCodeSymbolRef(codeHandling.viewComponentSymbol)}`\n : undefined,\n ...(codeHandling.declarationSymbols ?? []).map((symbol) => (\n `Declaration symbol: ${formatCodeSymbolRef(symbol)}`\n )),\n ...(options.includeNotes ? (codeHandling.notes ?? []) : []),\n ]);\n}\n"]}
@@ -12,20 +12,42 @@ export interface MarkdownCodeExample {
12
12
  export declare function compileMarkdownTemplate<TModel>(template: string): (model: TModel) => string;
13
13
  export declare function toMarkdownListItems(values: Array<string | undefined>): MarkdownListItem[] | undefined;
14
14
  export declare function toMarkdownCodeExampleNotes(values: string[] | undefined): MarkdownListItem[] | undefined;
15
+ /**
16
+ * The IMPORT SPECIFIER for a symbol — `packageName`, plus `importPath` only when that
17
+ * is a public subpath the owning package declares in `package.json#exports`.
18
+ *
19
+ * `filePathHint` is deliberately NOT consulted here. It is a module location, and
20
+ * concatenating it onto the package name is exactly the defect issue #150 records:
21
+ * an application package declares no export-map entry for its internal modules, so
22
+ * `@app/main-app/modules/.../tasks.ui-behavior` cannot resolve, and a coding agent was
23
+ * being handed it as the address to import from.
24
+ */
15
25
  export declare function formatImportTarget(symbol: {
16
26
  packageName: string;
17
27
  importPath?: string;
18
28
  }): string;
29
+ /**
30
+ * The LOCATION sentence appended after an import instruction, when the ref carries one.
31
+ *
32
+ * Rendered as prose rather than as a specifier so no downstream reader can mistake it
33
+ * for something importable — the whole point of splitting the two senses. Empty string
34
+ * when unauthored, so every caller can append it unconditionally.
35
+ */
36
+ export declare function formatSymbolLocationSuffix(symbol: {
37
+ filePathHint?: string;
38
+ }): string;
19
39
  export declare function formatCodeSymbolRef(symbol: {
20
40
  packageName: string;
21
41
  exportName: string;
22
42
  importPath?: string;
43
+ filePathHint?: string;
23
44
  }): string;
24
45
  export declare function formatNamedMemberRef(namedMember: {
25
46
  declaration: {
26
47
  packageName: string;
27
48
  exportName: string;
28
49
  importPath?: string;
50
+ filePathHint?: string;
29
51
  };
30
52
  memberName: string;
31
53
  }): string;
@@ -34,6 +56,7 @@ export declare function formatCollectionEntryRef(collectionEntry: {
34
56
  packageName: string;
35
57
  exportName: string;
36
58
  importPath?: string;
59
+ filePathHint?: string;
37
60
  };
38
61
  identifierField: string;
39
62
  identifierValue: string;
@@ -1 +1 @@
1
- {"version":3,"file":"specification-context-factory.shared.d.ts","sourceRoot":"","sources":["../../../../../src/core/specifications/specification-context-factory.shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,yBAAyB,EACzB,6BAA6B,EAC9B,MAAM,+BAA+B,CAAC;AAIvC,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAC5B;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAG3F;AAED,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,GAChC,gBAAgB,EAAE,GAAG,SAAS,CAKhC;AAED,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,GAC3B,gBAAgB,EAAE,GAAG,SAAS,CAEhC;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE;IACzC,WAAW,EAAE,MAAM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,MAAM,WAAW,oCAAoC;IACnD,gBAAgB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;CAC3C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AACH,wBAAgB,6BAA6B,CAC3C,gBAAgB,EAAE,6BAA6B,GAAG,SAAS,EAC3D,OAAO,EAAE,oCAAoC,GAC5C,MAAM,EAAE,GAAG,SAAS,CAkBtB;AAED,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,yBAAyB,CAAC;IACpC;;;;OAIG;IACH,MAAM,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;CACvC;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,cAAc,GAAG,MAAM,CAwBtE"}
1
+ {"version":3,"file":"specification-context-factory.shared.d.ts","sourceRoot":"","sources":["../../../../../src/core/specifications/specification-context-factory.shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,yBAAyB,EACzB,6BAA6B,EAC9B,MAAM,+BAA+B,CAAC;AAIvC,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAC5B;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,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 export function toMarkdownListItems(values) {
13
13
  export function toMarkdownCodeExampleNotes(values) {
14
14
  return toMarkdownListItems(values ?? []);
15
15
  }
16
+ /**
17
+ * The IMPORT SPECIFIER for a symbol — `packageName`, plus `importPath` only when that
18
+ * is a public subpath the owning package declares in `package.json#exports`.
19
+ *
20
+ * `filePathHint` is deliberately NOT consulted here. It is a module location, and
21
+ * concatenating it onto the package name is exactly the defect issue #150 records:
22
+ * an application package declares no export-map entry for its internal modules, so
23
+ * `@app/main-app/modules/.../tasks.ui-behavior` cannot resolve, and a coding agent was
24
+ * being handed it as the address to import from.
25
+ */
16
26
  export function formatImportTarget(symbol) {
17
27
  return symbol.importPath ? `${symbol.packageName}/${symbol.importPath}` : symbol.packageName;
18
28
  }
29
+ /**
30
+ * The LOCATION sentence appended after an import instruction, when the ref carries one.
31
+ *
32
+ * Rendered as prose rather than as a specifier so no downstream reader can mistake it
33
+ * for something importable — the whole point of splitting the two senses. Empty string
34
+ * when unauthored, so every caller can append it unconditionally.
35
+ */
36
+ export function formatSymbolLocationSuffix(symbol) {
37
+ return symbol.filePathHint
38
+ ? ` It is defined at \`${symbol.filePathHint}\` inside that package — a location for reading, not an import path.`
39
+ : '';
40
+ }
19
41
  export function formatCodeSymbolRef(symbol) {
20
- return `Import \`${symbol.exportName}\` from \`${formatImportTarget(symbol)}\`.`;
42
+ return `Import \`${symbol.exportName}\` from \`${formatImportTarget(symbol)}\`.${formatSymbolLocationSuffix(symbol)}`;
21
43
  }
22
44
  export function formatNamedMemberRef(namedMember) {
23
- return `Use member \`${namedMember.memberName}\` from \`${namedMember.declaration.exportName}\` imported via \`${formatImportTarget(namedMember.declaration)}\`.`;
45
+ return `Use member \`${namedMember.memberName}\` from \`${namedMember.declaration.exportName}\` imported via \`${formatImportTarget(namedMember.declaration)}\`.${formatSymbolLocationSuffix(namedMember.declaration)}`;
24
46
  }
25
47
  export function formatCollectionEntryRef(collectionEntry) {
26
- return `Use the entry where \`${collectionEntry.identifierField}\` is \`${collectionEntry.identifierValue}\` from \`${collectionEntry.collectionSymbol.exportName}\` imported via \`${formatImportTarget(collectionEntry.collectionSymbol)}\`.`;
48
+ return `Use the entry where \`${collectionEntry.identifierField}\` is \`${collectionEntry.identifierValue}\` from \`${collectionEntry.collectionSymbol.exportName}\` imported via \`${formatImportTarget(collectionEntry.collectionSymbol)}\`.${formatSymbolLocationSuffix(collectionEntry.collectionSymbol)}`;
27
49
  }
28
50
  /**
29
51
  * Render a `SpecificationOwnerRef` as a list of bullet-ready lines:
@@ -250,7 +272,7 @@ function formatEnumUsageLines(params) {
250
272
  const lines = [];
251
273
  const enumDecl = params.enumDeclaration;
252
274
  if (enumDecl) {
253
- lines.push(` Import: \`${enumDecl.exportName}\` from \`${formatImportTarget(enumDecl)}\``);
275
+ lines.push(` Import: \`${enumDecl.exportName}\` from \`${formatImportTarget(enumDecl)}\`${formatSymbolLocationSuffix(enumDecl)}`);
254
276
  }
255
277
  const values = params.values;
256
278
  if (values && Object.keys(values).length > 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"specification-context-factory.shared.js","sourceRoot":"","sources":["../../../../../src/core/specifications/specification-context-factory.shared.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,UAAU,MAAM,YAAY,CAAC;AAcpC,MAAM,UAAU,uBAAuB,CAAS,QAAgB;IAC9D,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IAChE,OAAO,CAAC,KAAa,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC;AAC3D,CAAC;AAED,MAAM,UAAU,mBAAmB,CACjC,MAAiC;IAEjC,MAAM,KAAK,GAAG,MAAM;SACjB,MAAM,CAAC,CAAC,KAAK,EAAmB,EAAE,CAAC,OAAO,CAAC,KAAK,IAAI,KAAK,CAA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erived,\n RequiredFeaturesSpecification,\n} from '@wildo-ai/saas-specifications';\nimport { CollectionElementKind } from '@wildo-ai/zod-decorators';\nimport Handlebars from 'handlebars';\n\nexport interface MarkdownListItem {\n text: string;\n}\n\nexport interface MarkdownCodeExample {\n title: string;\n description?: string;\n language: string;\n code: string;\n notes?: MarkdownListItem[];\n}\n\nexport function compileMarkdownTemplate<TModel>(template: string): (model: TModel) => string {\n const render = Handlebars.compile(template, { noEscape: true });\n return (model: TModel) => render(model).trimEnd() + '\\n';\n}\n\nexport function toMarkdownListItems(\n values: Array<string | undefined>,\n): MarkdownListItem[] | undefined {\n const items = values\n .filter((value): value is string => Boolean(value && value.trim().length))\n .map((value) => ({ text: value }));\n return items.length > 0 ? items : undefined;\n}\n\nexport function toMarkdownCodeExampleNotes(\n values: string[] | undefined,\n): MarkdownListItem[] | undefined {\n return toMarkdownListItems(values ?? []);\n}\n\nexport function formatImportTarget(symbol: {\n packageName: string;\n importPath?: string;\n}): string {\n return symbol.importPath ? `${symbol.packageName}/${symbol.importPath}` : symbol.packageName;\n}\n\nexport function formatCodeSymbolRef(symbol: {\n packageName: string;\n exportName: string;\n importPath?: string;\n}): string {\n return `Import \\`${symbol.exportName}\\` from \\`${formatImportTarget(symbol)}\\`.`;\n}\n\nexport function formatNamedMemberRef(namedMember: {\n declaration: {\n packageName: string;\n exportName: string;\n importPath?: string;\n };\n memberName: string;\n}): string {\n return `Use member \\`${namedMember.memberName}\\` from \\`${namedMember.declaration.exportName}\\` imported via \\`${formatImportTarget(namedMember.declaration)}\\`.`;\n}\n\nexport function formatCollectionEntryRef(collectionEntry: {\n collectionSymbol: {\n packageName: string;\n exportName: string;\n importPath?: string;\n };\n identifierField: string;\n identifierValue: string;\n}): string {\n return `Use the entry where \\`${collectionEntry.identifierField}\\` is \\`${collectionEntry.identifierValue}\\` from \\`${collectionEntry.collectionSymbol.exportName}\\` imported via \\`${formatImportTarget(collectionEntry.collectionSymbol)}\\`.`;\n}\n\n/**\n * Render a `SpecificationOwnerRef` as a list of bullet-ready lines:\n * one header line carrying the owner identity, followed by one bullet\n * per authored note.\n *\n * # Companion-bullet contract\n *\n * `SpecificationOwnerRef.notes` is a `string[]` of distinct caveats —\n * see `engine/saas-specifications/src/_core/definition-specification.schemas.ts`\n * (\"Extra caveats for downstream tooling when ownership alone is not\n * enough\"). The earlier inline `Notes: ${notes.join(' ')}` flatten\n * silently merged authored entries onto a single line and broke the\n * companion-bullet promise that downstream tooling depends on for\n * grep-able per-note lines (`Owner note: ...`). This mirrors the\n * symmetric fix landed for `TranslationSlotSpecification.notes` in\n * `non-composite-view-specification-context.shared.ts` +\n * `composite-view-specification-context.factory.ts` — see the\n * `TranslationSlotSpecification.notes` JSDoc in\n * `engine/saas-specifications/src/_core/translation-slot-specification.schemas.ts`\n * for the canonical multi-bullet contract.\n *\n * # Why an array, not a string\n *\n * Returning `string[]` makes the per-bullet contract enforced at the\n * type level: every list-shaped consumer must spread the result into\n * its `toMarkdownListItems([...lines])` call, which means each note is\n * guaranteed to surface as its own structural bullet. The previous\n * single-string API let the notes silently collapse onto the caller's\n * adjacent line without any signal at the call site.\n *\n * # Inline-then-extract consumers\n *\n * Renderers whose macro pattern packs multiple owner-bearing items onto\n * a single bullet line (e.g. the frontend-component contribution\n * rendering — \"one bullet per contribution\") cannot spread the bullet\n * array into a list. Those call sites use {@link formatOwnerRefHeader}\n * for the inline `Owner: …` fragment in the structural summary, and\n * separately map `owner.notes` to per-bullet lines with their own\n * path-aware label (e.g. `${contributionLabel} owner note: ${note}`)\n * so that authored owner notes still surface as their own bullets in\n * the parent bullet block. This avoids collapsing distinct owner notes\n * into a single inline blob while still respecting the macro pattern.\n */\nexport function formatOwnerRefBullets(owner: {\n ownerId: string;\n ownerKind: string;\n notes?: string[];\n}): string[] {\n const header = formatOwnerRefHeader(owner);\n const noteLines = (owner.notes ?? []).map((note) => `Owner note: ${note}`);\n return [header, ...noteLines];\n}\n\n/**\n * Single-line `Owner: …` fragment for inline-then-extract consumers.\n *\n * Returns only the owner identity header (without any note bullets),\n * suitable for embedding inside a single structural summary line that\n * already aggregates several fields (e.g. a frontend-component\n * contribution line with kind/identity/path/load/owner/symbols all\n * joined). Owner notes MUST be emitted separately as their own bullets\n * by the caller — this helper deliberately drops them so the inline\n * fragment stays compact and the per-bullet contract for\n * `SpecificationOwnerRef.notes` is honoured at the parent bullet block.\n *\n * Use {@link formatOwnerRefBullets} for list-shaped consumers that can\n * spread the bullet array directly.\n */\nexport function formatOwnerRefHeader(owner: {\n ownerId: string;\n ownerKind: string;\n}): string {\n return `Owner: \\`${owner.ownerId}\\` (\\`${owner.ownerKind}\\`).`;\n}\n\nexport function formatLiteralLine(label: string, value: string | undefined): string | undefined {\n return value && value.trim().length > 0 ? `${label}: ${value}` : undefined;\n}\n\n/**\n * Per-call options for {@link formatRequiredFeaturesBullets}.\n *\n * `formatFeatureRef` decides how each authored `featureRef` literal is\n * rendered inside the produced lines. Two contracts coexist in the\n * renderer family today, both honoured by this single helper:\n *\n * - **Onboarding-view / future flow-gating call sites** pass\n * `formatFeatureRefWithCrossLink` from `cross-registry-rendering.shared`\n * so unresolved refs surface a `(unknown)` flag (matches the\n * fail-closed validator contract in\n * `assertOptionalRequiredFeaturesSpecification` with\n * `crossRegistry: 'fail-closed'`).\n * - **M2M (outbound webhook) call site** passes a bare\n * `(ref) => \\`\\\\\\`${ref}\\\\\\`\\`` formatter — the M2M dispatcher honours\n * any application-defined gate beyond the engine baseline (see\n * `ResourceOperationM2MSpecification.requiredFeatures` JSDoc),\n * so the renderer must NOT decorate refs the spec registry doesn't\n * know about. Decoration would mislead readers into thinking M2M\n * has a registry-resolution invariant that does not exist at runtime.\n * See `cross-registry-rendering.shared.ts` \"M2M is intentionally out\n * of scope\" section for the matching renderer-side rationale.\n */\nexport interface FormatRequiredFeaturesBulletsOptions {\n formatFeatureRef: (ref: string) => string;\n}\n\n/**\n * Render the optional `requiredFeatures` documentation slot as a\n * header line + per-`limitChecks[i]` bullet block. Returns `undefined`\n * when the slot is absent so callers' `.filter(Boolean)` /\n * `toMarkdownListItems(...)` strips it cleanly.\n *\n * # Output shape\n *\n * Header line:\n * - `Required features: \\`A\\`, \\`B\\`` when `mode` is unset or `'OR'`\n * (the runtime default — surfacing \"(mode: OR)\" on every authored\n * slot adds noise without adding information).\n * - `Required features: \\`A\\`, \\`B\\` (mode: AND)` when `mode === 'AND'`\n * (the rare authored override — flagged so AI / human readers\n * immediately see the deviating combination semantics).\n *\n * One bullet per `limitChecks[i]`:\n * - `Limit check: \\`<featureRef>\\``\n * - `Limit check: \\`<featureRef>\\` · increment=<N>` when `increment` is\n * authored (matches the runtime `LimitCheckSchema.increment` field).\n * - `Limit check: \\`<featureRef>\\` · countingOverride=present` when an\n * authored `countingOverride` object exists. The shape of that object\n * is intentionally not enumerated at the spec layer\n * (`assertOptionalCountingOverrideShape` only checks it's an object —\n * the runtime axes of `LimitCountingConfig` are not mirrored), so the\n * renderer surfaces presence-only rather than re-serialising the\n * payload. Authors who want detail should consult the runtime\n * `LimitCountingConfig` schema directly.\n *\n * # Why a single helper for two consumers\n *\n * Both M2M (`ResourceOperationM2MSpecification.requiredFeatures`) and\n * onboarding-view (`OnboardingViewSpecificationConfig.requiredFeatures`)\n * consume the same `RequiredFeaturesSpecification` schema (extracted\n * by `non-view-specification-coverage` Step 5 Phase 0). Before this\n * helper existed, M2M emitted a single inline headline-part while\n * onboarding-view emitted a multi-line bullet block — two divergent\n * renderings for one structural type, with no semantic justification\n * for the asymmetry. This helper unifies both surfaces on the\n * onboarding-view-shaped multi-line bullets (the strictly more\n * informative form). See Phase 4.5 finding F-4 in\n * `m2m-webhook-organization-delivery-phase4-audit.md` for the audit.\n *\n * # Consumers\n *\n * All three surfaces that read the same `RequiredFeaturesSpecification`\n * schema now flow through this helper:\n *\n * 1. **M2M (outbound webhook)** — `resource-specification-context\n * .factory.ts → formatM2MRequiredFeaturesLine` — passes the bare\n * `(ref) => \\`\\\\\\`${ref}\\\\\\`\\`` formatter (no cross-link decoration,\n * per the M2M-out-of-scope rationale above).\n * 2. **Onboarding view** — `onboarding-view-specification-context\n * .factory.ts → buildRequiredFeaturesLines` — passes\n * `formatFeatureRefWithCrossLink` so unresolved refs surface the\n * `(unknown)` flag.\n * 3. **Guidance flow audience block** — `guidance-flow-specification-context\n * .factory.ts → buildAudienceLines` — same `formatFeatureRefWithCrossLink`\n * contract as the onboarding-view caller. Migrated from a divergent\n * inline `Required features (OR): …` rendering by P3/I1 closure of\n * `.cursor/plans/non-view-specification-coverage-step9-spec-infrastructure-hardening.md`\n * (originally tracked in `m2m-webhook-organization-delivery-phase4-5-hardening.md`\n * Step 4 follow-up). Before that closure the audience block always\n * emitted `(OR)` even when the mode was the runtime default — the\n * inline implementation also bypassed `formatFeatureRefWithCrossLink`\n * so dangling feature refs were not flagged.\n */\nexport function formatRequiredFeaturesBullets(\n requiredFeatures: RequiredFeaturesSpecification | undefined,\n options: FormatRequiredFeaturesBulletsOptions,\n): string[] | undefined {\n if (!requiredFeatures) {\n return undefined;\n }\n const refs = requiredFeatures.featureRefs.map(options.formatFeatureRef).join(', ');\n const modeSuffix = requiredFeatures.mode === 'AND' ? ' (mode: AND)' : '';\n const lines: string[] = [`Required features: ${refs}${modeSuffix}`];\n for (const limitCheck of requiredFeatures.limitChecks ?? []) {\n const ref = options.formatFeatureRef(limitCheck.featureRef);\n const incrementSuffix = typeof limitCheck.increment === 'number'\n ? ` · increment=${limitCheck.increment}`\n : '';\n const countingOverrideSuffix = limitCheck.countingOverride !== undefined\n ? ' · countingOverride=present'\n : '';\n lines.push(`Limit check: ${ref}${incrementSuffix}${countingOverrideSuffix}`);\n }\n return lines;\n}\n\nexport interface FieldSpecInput {\n fieldName: string;\n specDecorator: string;\n params: Record<string, unknown>;\n /**\n * Framework-derived structural metadata extracted from the Zod schema\n * (and, in Phase 2B, the relationship registry). The renderer consults\n * `derived` for structural facts — e.g. `arraySpec` element kind / primitive\n * type / union branches — so authors no longer hand-author what the\n * framework can compute. Author-supplied fields (`elementMeaning`,\n * `enumDeclaration`, `notes`) still come from `params`.\n */\n derived?: ExtractedFieldSpecDerived;\n /**\n * Where this field came from in the resource schema chain — derived from\n * the engine's `ExtractedFieldSpec.origin` (the owning vocabulary in\n * `@wildo-ai/saas-specifications`) rather than re-declared here.\n */\n origin?: ExtractedFieldSpec['origin'];\n}\n\n/**\n * Renders a field spec into a multi-line markdown block with:\n * - A heading line showing the field name, meaning, decorator, importance, and origin.\n * - Sub-lines for decorator-specific usage details (enum values, FK target, etc.).\n *\n * Lines are joined with `\\n` so templates that render each field as a list\n * item still get one logical block per field.\n */\nexport function formatFieldSpecBlock(fieldSpec: FieldSpecInput): string {\n const params = fieldSpec.params;\n const meaning = typeof params.meaning === 'string' ? params.meaning : undefined;\n const whyItMatters = typeof params.whyItMatters === 'string' ? params.whyItMatters : undefined;\n const importance = typeof params.importance === 'string' ? params.importance : undefined;\n\n const originSuffix = formatFieldOrigin(fieldSpec.origin);\n const importanceSuffix = importance ? ` [${importance}]` : '';\n\n const heading = meaning\n ? `\\`${fieldSpec.fieldName}\\` (${fieldSpec.specDecorator}${importanceSuffix}): ${meaning}${originSuffix}`\n : `\\`${fieldSpec.fieldName}\\` (${fieldSpec.specDecorator}${importanceSuffix})${originSuffix}`;\n\n const subLines: string[] = [];\n\n if (whyItMatters) {\n subLines.push(` Why it matters: ${whyItMatters}`);\n }\n\n subLines.push(...formatDecoratorUsageLines(fieldSpec.specDecorator, params, fieldSpec.derived));\n\n return subLines.length > 0\n ? [heading, ...subLines].join('\\n')\n : heading;\n}\n\nfunction formatFieldOrigin(\n origin: FieldSpecInput['origin'],\n): string {\n if (!origin) {\n return '';\n }\n if (origin.scope === 'inherited' && origin.variantPath?.length) {\n const path = origin.variantPath\n .map((seg) => `${seg.discriminatorField}=${seg.discriminatorValue}`)\n .join(' → ');\n return ` (inherited via ${path})`;\n }\n return origin.scope === 'inherited' ? ' (inherited)' : '';\n}\n\n/**\n * Produces sub-lines specific to each decorator type. Each line is\n * indented with two spaces so it renders as nested context below\n * the heading in a markdown list.\n */\nfunction formatDecoratorUsageLines(\n decorator: string,\n params: Record<string, unknown>,\n derived: ExtractedFieldSpecDerived | undefined,\n): string[] {\n switch (decorator) {\n case 'enumSpec':\n return formatEnumUsageLines(params);\n case 'foreignKeySpec':\n return formatForeignKeyUsageLines(params, derived);\n case 'arraySpec':\n return formatArrayUsageLines(params, derived);\n case 'stringSpec':\n return formatStringUsageLines(params);\n case 'numberSpec':\n case 'bigDecimalSpec':\n return formatNumberUsageLines(params);\n case 'dateSpec':\n case 'dateTimeSpec':\n return formatDateUsageLines(params);\n case 'objectSpec':\n return formatObjectUsageLines(params);\n default:\n return [];\n }\n}\n\nfunction formatEnumUsageLines(params: Record<string, unknown>): string[] {\n const lines: string[] = [];\n\n const enumDecl = params.enumDeclaration as\n | { packageName: string; exportName: string; importPath?: string }\n | undefined;\n if (enumDecl) {\n lines.push(` Import: \\`${enumDecl.exportName}\\` from \\`${formatImportTarget(enumDecl)}\\``);\n }\n\n const values = params.values as Record<string, { meaning?: string }> | undefined;\n if (values && Object.keys(values).length > 0) {\n lines.push(' Values:');\n for (const [value, config] of Object.entries(values)) {\n const valueMeaning = config?.meaning;\n lines.push(valueMeaning\n ? ` - \\`${value}\\`: ${valueMeaning}`\n : ` - \\`${value}\\``);\n }\n }\n\n return lines;\n}\n\n/**\n * Renders foreign-key usage by combining:\n *\n * - Author-supplied prose from `params.relationshipContext` (the business\n * meaning of the link — not derivable from the registry).\n * - Registry-derived target from `derived.foreignKeyTarget.resourceType`\n * (Phase 2B — the relationship registry's `foreignKeyField` is the\n * single source of truth for FK target resolution per Q6-2b).\n * - A fail-closed unresolved signal from\n * `derived.foreignKeyTargetUnresolved` so prompts stay honest about a\n * missing relationship instead of silently dropping the FK line. The\n * Phase 4 completeness validator promotes the same signal into a hard\n * error at companion-load time; the renderer surfaces it earlier so it\n * shows up in already-rendered prompts even if the validator is opt-in.\n */\nfunction formatForeignKeyUsageLines(\n params: Record<string, unknown>,\n derived: ExtractedFieldSpecDerived | undefined,\n): string[] {\n const lines: string[] = [];\n\n const relationshipContext = typeof params.relationshipContext === 'string'\n ? params.relationshipContext\n : undefined;\n if (relationshipContext) {\n lines.push(` Relationship: ${relationshipContext}`);\n }\n\n const target = derived?.foreignKeyTarget;\n if (target) {\n lines.push(` Target resource: \\`${target.resourceType}\\``);\n } else if (derived?.foreignKeyTargetUnresolved) {\n const unresolved = derived.foreignKeyTargetUnresolved;\n lines.push(\n ` Target resource: UNRESOLVED — ${unresolved.reason}.`,\n );\n }\n\n return lines;\n}\n\n/**\n * Renders array element details by combining:\n *\n * - Author-supplied semantics from `params.elementType` (`enumDeclaration`\n * for the vocabulary import path; `notes` for free-form caveats).\n * - Framework-derived structural facts from `derived.arrayElement`\n * (`kind`, `primitiveType`, `unionBranches`).\n *\n * The split mirrors Step 6 D-6 Phase 2A: structural truth lives in the Zod\n * schema and is computed once by the extractor; intent and import-path\n * anchors stay author-supplied because they are not derivable from the\n * runtime schema.\n */\nfunction formatArrayUsageLines(\n params: Record<string, unknown>,\n derived: ExtractedFieldSpecDerived | undefined,\n): string[] {\n const lines: string[] = [];\n\n const elementMeaning = typeof params.elementMeaning === 'string'\n ? params.elementMeaning\n : undefined;\n if (elementMeaning) {\n lines.push(` Element meaning: ${elementMeaning}`);\n }\n\n const authoredElementType = params.elementType as\n | {\n enumDeclaration?: { packageName: string; exportName: string; importPath?: string };\n notes?: string[];\n }\n | undefined;\n\n const arrayElement = derived?.arrayElement;\n\n if (arrayElement) {\n const kindLabel = arrayElement.kind;\n const enumDecl = authoredElementType?.enumDeclaration;\n const enumDetail = enumDecl\n ? ` — use \\`${enumDecl.exportName}\\` from \\`${formatImportTarget(enumDecl)}\\``\n : '';\n const primitiveDetail = arrayElement.kind === CollectionElementKind.PRIMITIVE && arrayElement.primitiveType\n ? ` (${arrayElement.primitiveType})`\n : '';\n lines.push(` Element type: ${kindLabel}${primitiveDetail}${enumDetail}`);\n\n if (arrayElement.kind === CollectionElementKind.UNION && arrayElement.unionBranches?.length) {\n lines.push(' Union branches:');\n for (const branch of arrayElement.unionBranches) {\n const branchDetail = branch.kind === CollectionElementKind.PRIMITIVE && branch.primitiveType\n ? ` (${branch.primitiveType})`\n : '';\n lines.push(` - ${branch.kind}${branchDetail}`);\n }\n }\n } else if (authoredElementType?.enumDeclaration) {\n // Fallback: tests / manually constructed `additionalFieldSpecs` that\n // bypass the extractor still want the import-path line surfaced.\n const enumDecl = authoredElementType.enumDeclaration;\n lines.push(` Element type: use \\`${enumDecl.exportName}\\` from \\`${formatImportTarget(enumDecl)}\\``);\n }\n\n for (const note of authoredElementType?.notes ?? []) {\n lines.push(` ${note}`);\n }\n\n return lines;\n}\n\nfunction formatStringUsageLines(params: Record<string, unknown>): string[] {\n const semanticRole = typeof params.semanticRole === 'string'\n ? params.semanticRole\n : undefined;\n return semanticRole\n ? [` Semantic role: ${semanticRole}`]\n : [];\n}\n\nfunction formatNumberUsageLines(params: Record<string, unknown>): string[] {\n const unit = typeof params.unit === 'string' ? params.unit : undefined;\n return unit ? [` Unit: ${unit}`] : [];\n}\n\nfunction formatDateUsageLines(params: Record<string, unknown>): string[] {\n const temporalRole = typeof params.temporalRole === 'string'\n ? params.temporalRole\n : undefined;\n return temporalRole\n ? [` Temporal role: ${temporalRole}`]\n : [];\n}\n\n/**\n * Object-spec usage lines are intentionally empty.\n *\n * `objectSpec()` carries no extra structural metadata after the Step 6 D-6\n * Phase 1 collapse — its `meaning` / `whyItMatters` / `importance` are\n * already rendered by the base block. The decorator still exists so the\n * Phase 4 completeness validator can detect spec-bearing nested structures,\n * but renderers contribute no additional lines for it.\n */\nfunction formatObjectUsageLines(_params: Record<string, unknown>): string[] {\n return [];\n}\n"]}
1
+ {"version":3,"file":"specification-context-factory.shared.js","sourceRoot":"","sources":["../../../../../src/core/specifications/specification-context-factory.shared.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,O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AAC,SAAS,CAAC;IACd,OAAO,YAAY;QACjB,CAAC,CAAC,CAAC,oBAAoB,YAAY,EAAE,CAAC;QACtC,CAAC,CAAC,EAAE,CAAC;AACT,CAAC;AAED,SAAS,sBAAsB,CAAC,MAA+B;IAC7D,MAAM,IAAI,GAAG,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IACvE,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACzC,CAAC;AAED,SAAS,oBAAoB,CAAC,MAA+B;IAC3D,MAAM,YAAY,GAAG,OAAO,MAAM,CAAC,YAAY,KAAK,QAAQ;QAC1D,CAAC,CAAC,MAAM,CAAC,YAAY;QACrB,CAAC,CAAC,SAAS,CAAC;IACd,OAAO,YAAY;QACjB,CAAC,CAAC,CAAC,oBAAoB,YAAY,EAAE,CAAC;QACtC,CAAC,CAAC,EAAE,CAAC;AACT,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,sBAAsB,CAAC,OAAgC;IAC9D,OAAO,EAAE,CAAC;AACZ,CAAC","sourcesContent":["import type {\n ExtractedFieldSpec,\n ExtractedFieldSpecDerived,\n RequiredFeaturesSpecification,\n} from '@wildo-ai/saas-specifications';\nimport { CollectionElementKind } from '@wildo-ai/zod-decorators';\nimport Handlebars from 'handlebars';\n\nexport interface MarkdownListItem {\n text: string;\n}\n\nexport interface MarkdownCodeExample {\n title: string;\n description?: string;\n language: string;\n code: string;\n notes?: MarkdownListItem[];\n}\n\nexport function compileMarkdownTemplate<TModel>(template: string): (model: TModel) => string {\n const render = Handlebars.compile(template, { noEscape: true });\n return (model: TModel) => render(model).trimEnd() + '\\n';\n}\n\nexport function toMarkdownListItems(\n values: Array<string | undefined>,\n): MarkdownListItem[] | undefined {\n const items = values\n .filter((value): value is string => Boolean(value && value.trim().length))\n .map((value) => ({ text: value }));\n return items.length > 0 ? items : undefined;\n}\n\nexport function toMarkdownCodeExampleNotes(\n values: string[] | undefined,\n): MarkdownListItem[] | undefined {\n return toMarkdownListItems(values ?? []);\n}\n\n/**\n * The IMPORT SPECIFIER for a symbol — `packageName`, plus `importPath` only when that\n * is a public subpath the owning package declares in `package.json#exports`.\n *\n * `filePathHint` is deliberately NOT consulted here. It is a module location, and\n * concatenating it onto the package name is exactly the defect issue #150 records:\n * an application package declares no export-map entry for its internal modules, so\n * `@app/main-app/modules/.../tasks.ui-behavior` cannot resolve, and a coding agent was\n * being handed it as the address to import from.\n */\nexport function formatImportTarget(symbol: {\n packageName: string;\n importPath?: string;\n}): string {\n return symbol.importPath ? `${symbol.packageName}/${symbol.importPath}` : symbol.packageName;\n}\n\n/**\n * The LOCATION sentence appended after an import instruction, when the ref carries one.\n *\n * Rendered as prose rather than as a specifier so no downstream reader can mistake it\n * for something importable — the whole point of splitting the two senses. Empty string\n * when unauthored, so every caller can append it unconditionally.\n */\nexport function formatSymbolLocationSuffix(symbol: { filePathHint?: string }): string {\n return symbol.filePathHint\n ? ` It is defined at \\`${symbol.filePathHint}\\` inside that package — a location for reading, not an import path.`\n : '';\n}\n\nexport function formatCodeSymbolRef(symbol: {\n packageName: string;\n exportName: string;\n importPath?: string;\n filePathHint?: string;\n}): string {\n return `Import \\`${symbol.exportName}\\` from \\`${formatImportTarget(symbol)}\\`.${formatSymbolLocationSuffix(symbol)}`;\n}\n\nexport function formatNamedMemberRef(namedMember: {\n declaration: {\n packageName: string;\n exportName: string;\n importPath?: string;\n filePathHint?: string;\n };\n memberName: string;\n}): string {\n return `Use member \\`${namedMember.memberName}\\` from \\`${namedMember.declaration.exportName}\\` imported via \\`${formatImportTarget(namedMember.declaration)}\\`.${formatSymbolLocationSuffix(namedMember.declaration)}`;\n}\n\nexport function formatCollectionEntryRef(collectionEntry: {\n collectionSymbol: {\n packageName: string;\n exportName: string;\n importPath?: string;\n filePathHint?: string;\n };\n identifierField: string;\n identifierValue: string;\n}): string {\n return `Use the entry where \\`${collectionEntry.identifierField}\\` is \\`${collectionEntry.identifierValue}\\` from \\`${collectionEntry.collectionSymbol.exportName}\\` imported via \\`${formatImportTarget(collectionEntry.collectionSymbol)}\\`.${formatSymbolLocationSuffix(collectionEntry.collectionSymbol)}`;\n}\n\n/**\n * Render a `SpecificationOwnerRef` as a list of bullet-ready lines:\n * one header line carrying the owner identity, followed by one bullet\n * per authored note.\n *\n * # Companion-bullet contract\n *\n * `SpecificationOwnerRef.notes` is a `string[]` of distinct caveats —\n * see `engine/saas-specifications/src/_core/definition-specification.schemas.ts`\n * (\"Extra caveats for downstream tooling when ownership alone is not\n * enough\"). The earlier inline `Notes: ${notes.join(' ')}` flatten\n * silently merged authored entries onto a single line and broke the\n * companion-bullet promise that downstream tooling depends on for\n * grep-able per-note lines (`Owner note: ...`). This mirrors the\n * symmetric fix landed for `TranslationSlotSpecification.notes` in\n * `non-composite-view-specification-context.shared.ts` +\n * `composite-view-specification-context.factory.ts` — see the\n * `TranslationSlotSpecification.notes` JSDoc in\n * `engine/saas-specifications/src/_core/translation-slot-specification.schemas.ts`\n * for the canonical multi-bullet contract.\n *\n * # Why an array, not a string\n *\n * Returning `string[]` makes the per-bullet contract enforced at the\n * type level: every list-shaped consumer must spread the result into\n * its `toMarkdownListItems([...lines])` call, which means each note is\n * guaranteed to surface as its own structural bullet. The previous\n * single-string API let the notes silently collapse onto the caller's\n * adjacent line without any signal at the call site.\n *\n * # Inline-then-extract consumers\n *\n * Renderers whose macro pattern packs multiple owner-bearing items onto\n * a single bullet line (e.g. the frontend-component contribution\n * rendering — \"one bullet per contribution\") cannot spread the bullet\n * array into a list. Those call sites use {@link formatOwnerRefHeader}\n * for the inline `Owner: …` fragment in the structural summary, and\n * separately map `owner.notes` to per-bullet lines with their own\n * path-aware label (e.g. `${contributionLabel} owner note: ${note}`)\n * so that authored owner notes still surface as their own bullets in\n * the parent bullet block. This avoids collapsing distinct owner notes\n * into a single inline blob while still respecting the macro pattern.\n */\nexport function formatOwnerRefBullets(owner: {\n ownerId: string;\n ownerKind: string;\n notes?: string[];\n}): string[] {\n const header = formatOwnerRefHeader(owner);\n const noteLines = (owner.notes ?? []).map((note) => `Owner note: ${note}`);\n return [header, ...noteLines];\n}\n\n/**\n * Single-line `Owner: …` fragment for inline-then-extract consumers.\n *\n * Returns only the owner identity header (without any note bullets),\n * suitable for embedding inside a single structural summary line that\n * already aggregates several fields (e.g. a frontend-component\n * contribution line with kind/identity/path/load/owner/symbols all\n * joined). Owner notes MUST be emitted separately as their own bullets\n * by the caller — this helper deliberately drops them so the inline\n * fragment stays compact and the per-bullet contract for\n * `SpecificationOwnerRef.notes` is honoured at the parent bullet block.\n *\n * Use {@link formatOwnerRefBullets} for list-shaped consumers that can\n * spread the bullet array directly.\n */\nexport function formatOwnerRefHeader(owner: {\n ownerId: string;\n ownerKind: string;\n}): string {\n return `Owner: \\`${owner.ownerId}\\` (\\`${owner.ownerKind}\\`).`;\n}\n\nexport function formatLiteralLine(label: string, value: string | undefined): string | undefined {\n return value && value.trim().length > 0 ? `${label}: ${value}` : undefined;\n}\n\n/**\n * Per-call options for {@link formatRequiredFeaturesBullets}.\n *\n * `formatFeatureRef` decides how each authored `featureRef` literal is\n * rendered inside the produced lines. Two contracts coexist in the\n * renderer family today, both honoured by this single helper:\n *\n * - **Onboarding-view / future flow-gating call sites** pass\n * `formatFeatureRefWithCrossLink` from `cross-registry-rendering.shared`\n * so unresolved refs surface a `(unknown)` flag (matches the\n * fail-closed validator contract in\n * `assertOptionalRequiredFeaturesSpecification` with\n * `crossRegistry: 'fail-closed'`).\n * - **M2M (outbound webhook) call site** passes a bare\n * `(ref) => \\`\\\\\\`${ref}\\\\\\`\\`` formatter — the M2M dispatcher honours\n * any application-defined gate beyond the engine baseline (see\n * `ResourceOperationM2MSpecification.requiredFeatures` JSDoc),\n * so the renderer must NOT decorate refs the spec registry doesn't\n * know about. Decoration would mislead readers into thinking M2M\n * has a registry-resolution invariant that does not exist at runtime.\n * See `cross-registry-rendering.shared.ts` \"M2M is intentionally out\n * of scope\" section for the matching renderer-side rationale.\n */\nexport interface FormatRequiredFeaturesBulletsOptions {\n formatFeatureRef: (ref: string) => string;\n}\n\n/**\n * Render the optional `requiredFeatures` documentation slot as a\n * header line + per-`limitChecks[i]` bullet block. Returns `undefined`\n * when the slot is absent so callers' `.filter(Boolean)` /\n * `toMarkdownListItems(...)` strips it cleanly.\n *\n * # Output shape\n *\n * Header line:\n * - `Required features: \\`A\\`, \\`B\\`` when `mode` is unset or `'OR'`\n * (the runtime default — surfacing \"(mode: OR)\" on every authored\n * slot adds noise without adding information).\n * - `Required features: \\`A\\`, \\`B\\` (mode: AND)` when `mode === 'AND'`\n * (the rare authored override — flagged so AI / human readers\n * immediately see the deviating combination semantics).\n *\n * One bullet per `limitChecks[i]`:\n * - `Limit check: \\`<featureRef>\\``\n * - `Limit check: \\`<featureRef>\\` · increment=<N>` when `increment` is\n * authored (matches the runtime `LimitCheckSchema.increment` field).\n * - `Limit check: \\`<featureRef>\\` · countingOverride=present` when an\n * authored `countingOverride` object exists. The shape of that object\n * is intentionally not enumerated at the spec layer\n * (`assertOptionalCountingOverrideShape` only checks it's an object —\n * the runtime axes of `LimitCountingConfig` are not mirrored), so the\n * renderer surfaces presence-only rather than re-serialising the\n * payload. Authors who want detail should consult the runtime\n * `LimitCountingConfig` schema directly.\n *\n * # Why a single helper for two consumers\n *\n * Both M2M (`ResourceOperationM2MSpecification.requiredFeatures`) and\n * onboarding-view (`OnboardingViewSpecificationConfig.requiredFeatures`)\n * consume the same `RequiredFeaturesSpecification` schema (extracted\n * by `non-view-specification-coverage` Step 5 Phase 0). Before this\n * helper existed, M2M emitted a single inline headline-part while\n * onboarding-view emitted a multi-line bullet block — two divergent\n * renderings for one structural type, with no semantic justification\n * for the asymmetry. This helper unifies both surfaces on the\n * onboarding-view-shaped multi-line bullets (the strictly more\n * informative form). See Phase 4.5 finding F-4 in\n * `m2m-webhook-organization-delivery-phase4-audit.md` for the audit.\n *\n * # Consumers\n *\n * All three surfaces that read the same `RequiredFeaturesSpecification`\n * schema now flow through this helper:\n *\n * 1. **M2M (outbound webhook)** — `resource-specification-context\n * .factory.ts → formatM2MRequiredFeaturesLine` — passes the bare\n * `(ref) => \\`\\\\\\`${ref}\\\\\\`\\`` formatter (no cross-link decoration,\n * per the M2M-out-of-scope rationale above).\n * 2. **Onboarding view** — `onboarding-view-specification-context\n * .factory.ts → buildRequiredFeaturesLines` — passes\n * `formatFeatureRefWithCrossLink` so unresolved refs surface the\n * `(unknown)` flag.\n * 3. **Guidance flow audience block** — `guidance-flow-specification-context\n * .factory.ts → buildAudienceLines` — same `formatFeatureRefWithCrossLink`\n * contract as the onboarding-view caller. Migrated from a divergent\n * inline `Required features (OR): …` rendering by P3/I1 closure of\n * `.cursor/plans/non-view-specification-coverage-step9-spec-infrastructure-hardening.md`\n * (originally tracked in `m2m-webhook-organization-delivery-phase4-5-hardening.md`\n * Step 4 follow-up). Before that closure the audience block always\n * emitted `(OR)` even when the mode was the runtime default — the\n * inline implementation also bypassed `formatFeatureRefWithCrossLink`\n * so dangling feature refs were not flagged.\n */\nexport function formatRequiredFeaturesBullets(\n requiredFeatures: RequiredFeaturesSpecification | undefined,\n options: FormatRequiredFeaturesBulletsOptions,\n): string[] | undefined {\n if (!requiredFeatures) {\n return undefined;\n }\n const refs = requiredFeatures.featureRefs.map(options.formatFeatureRef).join(', ');\n const modeSuffix = requiredFeatures.mode === 'AND' ? ' (mode: AND)' : '';\n const lines: string[] = [`Required features: ${refs}${modeSuffix}`];\n for (const limitCheck of requiredFeatures.limitChecks ?? []) {\n const ref = options.formatFeatureRef(limitCheck.featureRef);\n const incrementSuffix = typeof limitCheck.increment === 'number'\n ? ` · increment=${limitCheck.increment}`\n : '';\n const countingOverrideSuffix = limitCheck.countingOverride !== undefined\n ? ' · countingOverride=present'\n : '';\n lines.push(`Limit check: ${ref}${incrementSuffix}${countingOverrideSuffix}`);\n }\n return lines;\n}\n\nexport interface FieldSpecInput {\n fieldName: string;\n specDecorator: string;\n params: Record<string, unknown>;\n /**\n * Framework-derived structural metadata extracted from the Zod schema\n * (and, in Phase 2B, the relationship registry). The renderer consults\n * `derived` for structural facts — e.g. `arraySpec` element kind / primitive\n * type / union branches — so authors no longer hand-author what the\n * framework can compute. Author-supplied fields (`elementMeaning`,\n * `enumDeclaration`, `notes`) still come from `params`.\n */\n derived?: ExtractedFieldSpecDerived;\n /**\n * Where this field came from in the resource schema chain — derived from\n * the engine's `ExtractedFieldSpec.origin` (the owning vocabulary in\n * `@wildo-ai/saas-specifications`) rather than re-declared here.\n */\n origin?: ExtractedFieldSpec['origin'];\n}\n\n/**\n * Renders a field spec into a multi-line markdown block with:\n * - A heading line showing the field name, meaning, decorator, importance, and origin.\n * - Sub-lines for decorator-specific usage details (enum values, FK target, etc.).\n *\n * Lines are joined with `\\n` so templates that render each field as a list\n * item still get one logical block per field.\n */\nexport function formatFieldSpecBlock(fieldSpec: FieldSpecInput): string {\n const params = fieldSpec.params;\n const meaning = typeof params.meaning === 'string' ? params.meaning : undefined;\n const whyItMatters = typeof params.whyItMatters === 'string' ? params.whyItMatters : undefined;\n const importance = typeof params.importance === 'string' ? params.importance : undefined;\n\n const originSuffix = formatFieldOrigin(fieldSpec.origin);\n const importanceSuffix = importance ? ` [${importance}]` : '';\n\n const heading = meaning\n ? `\\`${fieldSpec.fieldName}\\` (${fieldSpec.specDecorator}${importanceSuffix}): ${meaning}${originSuffix}`\n : `\\`${fieldSpec.fieldName}\\` (${fieldSpec.specDecorator}${importanceSuffix})${originSuffix}`;\n\n const subLines: string[] = [];\n\n if (whyItMatters) {\n subLines.push(` Why it matters: ${whyItMatters}`);\n }\n\n subLines.push(...formatDecoratorUsageLines(fieldSpec.specDecorator, params, fieldSpec.derived));\n\n return subLines.length > 0\n ? [heading, ...subLines].join('\\n')\n : heading;\n}\n\nfunction formatFieldOrigin(\n origin: FieldSpecInput['origin'],\n): string {\n if (!origin) {\n return '';\n }\n if (origin.scope === 'inherited' && origin.variantPath?.length) {\n const path = origin.variantPath\n .map((seg) => `${seg.discriminatorField}=${seg.discriminatorValue}`)\n .join(' → ');\n return ` (inherited via ${path})`;\n }\n return origin.scope === 'inherited' ? ' (inherited)' : '';\n}\n\n/**\n * Produces sub-lines specific to each decorator type. Each line is\n * indented with two spaces so it renders as nested context below\n * the heading in a markdown list.\n */\nfunction formatDecoratorUsageLines(\n decorator: string,\n params: Record<string, unknown>,\n derived: ExtractedFieldSpecDerived | undefined,\n): string[] {\n switch (decorator) {\n case 'enumSpec':\n return formatEnumUsageLines(params);\n case 'foreignKeySpec':\n return formatForeignKeyUsageLines(params, derived);\n case 'arraySpec':\n return formatArrayUsageLines(params, derived);\n case 'stringSpec':\n return formatStringUsageLines(params);\n case 'numberSpec':\n case 'bigDecimalSpec':\n return formatNumberUsageLines(params);\n case 'dateSpec':\n case 'dateTimeSpec':\n return formatDateUsageLines(params);\n case 'objectSpec':\n return formatObjectUsageLines(params);\n default:\n return [];\n }\n}\n\nfunction formatEnumUsageLines(params: Record<string, unknown>): string[] {\n const lines: string[] = [];\n\n const enumDecl = params.enumDeclaration as\n | { packageName: string; exportName: string; importPath?: string; filePathHint?: string }\n | undefined;\n if (enumDecl) {\n lines.push(` Import: \\`${enumDecl.exportName}\\` from \\`${formatImportTarget(enumDecl)}\\`${formatSymbolLocationSuffix(enumDecl)}`);\n }\n\n const values = params.values as Record<string, { meaning?: string }> | undefined;\n if (values && Object.keys(values).length > 0) {\n lines.push(' Values:');\n for (const [value, config] of Object.entries(values)) {\n const valueMeaning = config?.meaning;\n lines.push(valueMeaning\n ? ` - \\`${value}\\`: ${valueMeaning}`\n : ` - \\`${value}\\``);\n }\n }\n\n return lines;\n}\n\n/**\n * Renders foreign-key usage by combining:\n *\n * - Author-supplied prose from `params.relationshipContext` (the business\n * meaning of the link — not derivable from the registry).\n * - Registry-derived target from `derived.foreignKeyTarget.resourceType`\n * (Phase 2B — the relationship registry's `foreignKeyField` is the\n * single source of truth for FK target resolution per Q6-2b).\n * - A fail-closed unresolved signal from\n * `derived.foreignKeyTargetUnresolved` so prompts stay honest about a\n * missing relationship instead of silently dropping the FK line. The\n * Phase 4 completeness validator promotes the same signal into a hard\n * error at companion-load time; the renderer surfaces it earlier so it\n * shows up in already-rendered prompts even if the validator is opt-in.\n */\nfunction formatForeignKeyUsageLines(\n params: Record<string, unknown>,\n derived: ExtractedFieldSpecDerived | undefined,\n): string[] {\n const lines: string[] = [];\n\n const relationshipContext = typeof params.relationshipContext === 'string'\n ? params.relationshipContext\n : undefined;\n if (relationshipContext) {\n lines.push(` Relationship: ${relationshipContext}`);\n }\n\n const target = derived?.foreignKeyTarget;\n if (target) {\n lines.push(` Target resource: \\`${target.resourceType}\\``);\n } else if (derived?.foreignKeyTargetUnresolved) {\n const unresolved = derived.foreignKeyTargetUnresolved;\n lines.push(\n ` Target resource: UNRESOLVED — ${unresolved.reason}.`,\n );\n }\n\n return lines;\n}\n\n/**\n * Renders array element details by combining:\n *\n * - Author-supplied semantics from `params.elementType` (`enumDeclaration`\n * for the vocabulary import path; `notes` for free-form caveats).\n * - Framework-derived structural facts from `derived.arrayElement`\n * (`kind`, `primitiveType`, `unionBranches`).\n *\n * The split mirrors Step 6 D-6 Phase 2A: structural truth lives in the Zod\n * schema and is computed once by the extractor; intent and import-path\n * anchors stay author-supplied because they are not derivable from the\n * runtime schema.\n */\nfunction formatArrayUsageLines(\n params: Record<string, unknown>,\n derived: ExtractedFieldSpecDerived | undefined,\n): string[] {\n const lines: string[] = [];\n\n const elementMeaning = typeof params.elementMeaning === 'string'\n ? params.elementMeaning\n : undefined;\n if (elementMeaning) {\n lines.push(` Element meaning: ${elementMeaning}`);\n }\n\n const authoredElementType = params.elementType as\n | {\n enumDeclaration?: { packageName: string; exportName: string; importPath?: string; filePathHint?: string };\n notes?: string[];\n }\n | undefined;\n\n const arrayElement = derived?.arrayElement;\n\n if (arrayElement) {\n const kindLabel = arrayElement.kind;\n const enumDecl = authoredElementType?.enumDeclaration;\n const enumDetail = enumDecl\n ? ` — use \\`${enumDecl.exportName}\\` from \\`${formatImportTarget(enumDecl)}\\``\n : '';\n const primitiveDetail = arrayElement.kind === CollectionElementKind.PRIMITIVE && arrayElement.primitiveType\n ? ` (${arrayElement.primitiveType})`\n : '';\n lines.push(` Element type: ${kindLabel}${primitiveDetail}${enumDetail}`);\n\n if (arrayElement.kind === CollectionElementKind.UNION && arrayElement.unionBranches?.length) {\n lines.push(' Union branches:');\n for (const branch of arrayElement.unionBranches) {\n const branchDetail = branch.kind === CollectionElementKind.PRIMITIVE && branch.primitiveType\n ? ` (${branch.primitiveType})`\n : '';\n lines.push(` - ${branch.kind}${branchDetail}`);\n }\n }\n } else if (authoredElementType?.enumDeclaration) {\n // Fallback: tests / manually constructed `additionalFieldSpecs` that\n // bypass the extractor still want the import-path line surfaced.\n const enumDecl = authoredElementType.enumDeclaration;\n lines.push(` Element type: use \\`${enumDecl.exportName}\\` from \\`${formatImportTarget(enumDecl)}\\``);\n }\n\n for (const note of authoredElementType?.notes ?? []) {\n lines.push(` ${note}`);\n }\n\n return lines;\n}\n\nfunction formatStringUsageLines(params: Record<string, unknown>): string[] {\n const semanticRole = typeof params.semanticRole === 'string'\n ? params.semanticRole\n : undefined;\n return semanticRole\n ? [` Semantic role: ${semanticRole}`]\n : [];\n}\n\nfunction formatNumberUsageLines(params: Record<string, unknown>): string[] {\n const unit = typeof params.unit === 'string' ? params.unit : undefined;\n return unit ? [` Unit: ${unit}`] : [];\n}\n\nfunction formatDateUsageLines(params: Record<string, unknown>): string[] {\n const temporalRole = typeof params.temporalRole === 'string'\n ? params.temporalRole\n : undefined;\n return temporalRole\n ? [` Temporal role: ${temporalRole}`]\n : [];\n}\n\n/**\n * Object-spec usage lines are intentionally empty.\n *\n * `objectSpec()` carries no extra structural metadata after the Step 6 D-6\n * Phase 1 collapse — its `meaning` / `whyItMatters` / `importance` are\n * already rendered by the base block. The decorator still exists so the\n * Phase 4 completeness validator can detect spec-bearing nested structures,\n * but renderers contribute no additional lines for it.\n */\nfunction formatObjectUsageLines(_params: Record<string, unknown>): string[] {\n return [];\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"companion-executions.companion.service.d.ts","sourceRoot":"","sources":["../../../../../src/executions/services/companion-executions.companion.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,0BAA0B,EAE1B,qCAAqC,EACrC,aAAa,EACb,yCAAyC,EACzC,2CAA2C,EAC3C,+BAA+B,EAGhC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,kBAAkB,EAClB,2BAA2B,EAI3B,2BAA2B,EAO5B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EACV,4BAA4B,EAC5B,+BAA+B,EAC/B,oCAAoC,EACpC,mCAAmC,EACnC,4BAA4B,EAC5B,+BAA+B,EAChC,MAAM,2CAA2C,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAE7E,OAAO,EAAE,4BAA4B,EAAE,MAAM,wDAAwD,CAAC;AACtG,OAAO,EAAuD,KAAK,gCAAgC,EAAE,MAAM,uDAAuD,CAAC;AAMnK,KAAK,uCAAuC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,GAAG;IAC3F,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,KAAK,sCAAsC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,GAAG;IAC1F,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,KAAK,4BAA4B,GAAG,CAAC,CAAC,KAAK,C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B;IAI9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,OAAO,CAAC,kCAAkC;IAS1C,OAAO,CAAC,oCAAoC;IA8B5C,OAAO,CAAC,0BAA0B;IAuClC,OAAO,CAAC,kCAAkC;IA0B1C;;;;;;;;;;;;;;;;;OAiBG;IACH,OAAO,CAAC,mBAAmB;IAK3B,OAAO,CAAC,yBAAyB;IAwBjC,OAAO,CAAC,UAAU;IASlB,OAAO,CAAC,uBAAuB;IAiB/B,OAAO,CAAC,gBAAgB;IAIxB;;;;OAIG;IACH,OAAO,CAAC,2BAA2B;IAWnC,OAAO,CAAC,sBAAsB;CAU/B"}
1
+ {"version":3,"file":"companion-executions.companion.service.d.ts","sourceRoot":"","sources":["../../../../../src/executions/services/companion-executions.companion.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,0BAA0B,EAE1B,qCAAqC,EACrC,aAAa,EACb,yCAAyC,EACzC,2CAA2C,EAC3C,+BAA+B,EAGhC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,kBAAkB,EAClB,2BAA2B,EAI3B,2BAA2B,EAO5B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EACV,4BAA4B,EAC5B,+BAA+B,EAC/B,oCAAoC,EACpC,mCAAmC,EACnC,4BAA4B,EAC5B,+BAA+B,EAChC,MAAM,2CAA2C,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAE7E,OAAO,EAAE,4BAA4B,EAAE,MAAM,wDAAwD,CAAC;AACtG,OAAO,EAAuD,KAAK,gCAAgC,EAAE,MAAM,uDAAuD,CAAC;AAMnK,KAAK,uCAAuC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,GAAG;IAC3F,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,EA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ACW,cAAc;YAiBd,qBAAqB;YAgDrB,gCAAgC;YA4BhC,6BAA6B;YAiD7B,+BAA+B;YAyC/B,oBAAoB;YAqBpB,yBAAyB;YAyBzB,uBAAuB;YAiBvB,6BAA6B;IAyD3C,OAAO,CAAC,wBAAwB;YASlB,mBAAmB;YAgCnB,qBAAqB;YAgCrB,qBAAqB;IAyBnC,OAAO,CAAC,sBAAsB;YAkBhB,oBAAoB;IAsClC,OAAO,CAAC,sBAAsB;IAI9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,OAAO,CAAC,kCAAkC;IAS1C,OAAO,CAAC,oCAAoC;IA8B5C,OAAO,CAAC,0BAA0B;IAuClC,OAAO,CAAC,kCAAkC;IA0B1C;;;;;;;;;;;;;;;;;OAiBG;IACH,OAAO,CAAC,mBAAmB;IAK3B,OAAO,CAAC,yBAAyB;IAwBjC,OAAO,CAAC,UAAU;IASlB,OAAO,CAAC,uBAAuB;IAiB/B,OAAO,CAAC,gBAAgB;IAIxB;;;;OAIG;IACH,OAAO,CAAC,2BAA2B;IAWnC,OAAO,CAAC,sBAAsB;CAU/B"}
@@ -408,6 +408,7 @@ let CompanionExecutionsCompanionService = class CompanionExecutionsCompanionServ
408
408
  organizationId: ownership.organizationId,
409
409
  wildoApplicationId: ownership.wildoApplicationId,
410
410
  ...(payload.wildoApplicationActorSystemExecutionId ? { wildoApplicationActorSystemExecutionId: payload.wildoApplicationActorSystemExecutionId } : {}),
411
+ ...(payload.workbenchBuildPlanTaskId ? { workbenchBuildPlanTaskId: payload.workbenchBuildPlanTaskId } : {}),
411
412
  };
412
413
  const createdTask = await repository.create(executionContext, createData, {
413
414
  ...this.buildRepositoryOptions(transaction),
@@ -1054,15 +1055,19 @@ let CompanionExecutionsCompanionService = class CompanionExecutionsCompanionServ
1054
1055
  if (fieldEntries.length === 0) {
1055
1056
  return;
1056
1057
  }
1058
+ /*
1059
+ * ADAPTER-NEUTRAL on purpose, and the previous body is the cautionary tale: it reached
1060
+ * `mongooseModel.findOneAndUpdate` + `getNativeSession` directly, which exists only on the
1061
+ * MongoDB repository — on a PostgreSQL-backed application (wonder-crm) the call threw
1062
+ * `repository.getNativeSession is not a function`, the interactive lane's park-persistence
1063
+ * write died on it, and the failure handler then recorded the whole parked run as
1064
+ * `agent_execution_failed`, destroying the suspension the restart-durability door needed
1065
+ * (measured 2026-09-04, first live park on PG). `atomicConditionalSet` is on the repository
1066
+ * CONTRACT — an adapter that cannot compile it fails to build — and its `clearFields` is
1067
+ * exactly the unset: `$unset` on MongoDB, `SET col = NULL` (+ read-path omission) on PG.
1068
+ */
1057
1069
  const repository = this.repositoriesRegistry.getRepositoryOrThrow(WILDO_APPLICATION_ACTOR_TASKS_RESOURCE_TYPE);
1058
- const session = repository.getNativeSession(this.buildRepositoryOptions(transaction));
1059
- await repository.mongooseModel.findOneAndUpdate({ _id: taskId, wildoApplicationId }, {
1060
- $unset: Object.fromEntries(fieldEntries),
1061
- }, {
1062
- runValidators: true,
1063
- new: true,
1064
- ...(session ? { session } : {}),
1065
- });
1070
+ await repository.atomicConditionalSet({ _id: taskId, wildoApplicationId }, undefined, fieldEntries.map(([field]) => field), this.buildRepositoryOptions(transaction));
1066
1071
  }
1067
1072
  buildRepositoryOptions(transaction) {
1068
1073
  return transaction ? { transaction } : undefined;