@wildo-ai/dev-companion 1.1.13 → 1.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. package/dist/esm/.tsbuildinfo +1 -1
  2. package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts +21 -0
  3. package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts.map +1 -1
  4. package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js +37 -4
  5. package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js.map +1 -1
  6. package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.d.ts.map +1 -1
  7. package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.js +9 -2
  8. package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.js.map +1 -1
  9. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.d.ts +66 -0
  10. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.d.ts.map +1 -1
  11. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js +183 -7
  12. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js.map +1 -1
  13. package/dist/esm/claude-cli/services/git-change-set.companion.service.d.ts +6 -2
  14. package/dist/esm/claude-cli/services/git-change-set.companion.service.d.ts.map +1 -1
  15. package/dist/esm/claude-cli/services/git-change-set.companion.service.js +16 -39
  16. package/dist/esm/claude-cli/services/git-change-set.companion.service.js.map +1 -1
  17. package/dist/esm/code-compliance-check/check-raw-feature-id-literals.companion.js +31 -2
  18. package/dist/esm/code-compliance-check/check-raw-feature-id-literals.companion.js.map +1 -1
  19. package/dist/esm/companion-api/companion-api.schemas.d.ts +2 -0
  20. package/dist/esm/companion-api/companion-api.schemas.d.ts.map +1 -1
  21. package/dist/esm/companion-api/companion-api.schemas.js +8 -0
  22. package/dist/esm/companion-api/companion-api.schemas.js.map +1 -1
  23. package/dist/esm/companion-api/controllers/companion.controller.d.ts +7 -0
  24. package/dist/esm/companion-api/controllers/companion.controller.d.ts.map +1 -1
  25. package/dist/esm/companion-api/controllers/companion.controller.js +26 -12
  26. package/dist/esm/companion-api/controllers/companion.controller.js.map +1 -1
  27. package/dist/esm/companion-api/controllers/long-held-request.companion.d.ts +17 -0
  28. package/dist/esm/companion-api/controllers/long-held-request.companion.d.ts.map +1 -0
  29. package/dist/esm/companion-api/controllers/long-held-request.companion.js +33 -0
  30. package/dist/esm/companion-api/controllers/long-held-request.companion.js.map +1 -0
  31. package/dist/esm/core/introspection/resources/creation-home-projection.companion.d.ts +9 -0
  32. package/dist/esm/core/introspection/resources/creation-home-projection.companion.d.ts.map +1 -1
  33. package/dist/esm/core/introspection/resources/creation-home-projection.companion.js +12 -0
  34. package/dist/esm/core/introspection/resources/creation-home-projection.companion.js.map +1 -1
  35. package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.d.ts.map +1 -1
  36. package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.js +7 -1
  37. package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.js.map +1 -1
  38. package/dist/esm/core/introspection/services/introspection-source-state.companion.service.d.ts +8 -20
  39. package/dist/esm/core/introspection/services/introspection-source-state.companion.service.d.ts.map +1 -1
  40. package/dist/esm/core/introspection/services/introspection-source-state.companion.service.js +37 -142
  41. package/dist/esm/core/introspection/services/introspection-source-state.companion.service.js.map +1 -1
  42. package/dist/esm/core/introspection/services/introspection-source-walk.worker.d.ts +64 -0
  43. package/dist/esm/core/introspection/services/introspection-source-walk.worker.d.ts.map +1 -0
  44. package/dist/esm/core/introspection/services/introspection-source-walk.worker.js +304 -0
  45. package/dist/esm/core/introspection/services/introspection-source-walk.worker.js.map +1 -0
  46. package/dist/esm/core/runtime/companion-language-model-route.d.ts +16 -1
  47. package/dist/esm/core/runtime/companion-language-model-route.d.ts.map +1 -1
  48. package/dist/esm/core/runtime/companion-language-model-route.js +23 -1
  49. package/dist/esm/core/runtime/companion-language-model-route.js.map +1 -1
  50. package/dist/esm/core/runtime/services/start-companion-application.service.d.ts.map +1 -1
  51. package/dist/esm/core/runtime/services/start-companion-application.service.js +3 -2
  52. package/dist/esm/core/runtime/services/start-companion-application.service.js.map +1 -1
  53. package/dist/esm/core/utils/git-read-broker.companion.d.ts +62 -0
  54. package/dist/esm/core/utils/git-read-broker.companion.d.ts.map +1 -0
  55. package/dist/esm/core/utils/git-read-broker.companion.js +282 -0
  56. package/dist/esm/core/utils/git-read-broker.companion.js.map +1 -0
  57. package/dist/esm/core/utils/local-write-recording.companion.d.ts +8 -1
  58. package/dist/esm/core/utils/local-write-recording.companion.d.ts.map +1 -1
  59. package/dist/esm/core/utils/local-write-recording.companion.js +7 -23
  60. package/dist/esm/core/utils/local-write-recording.companion.js.map +1 -1
  61. package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.en.d.ts +29 -0
  62. package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.en.d.ts.map +1 -0
  63. package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.en.js +29 -0
  64. package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.en.js.map +1 -0
  65. package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.fr.d.ts +29 -0
  66. package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.fr.d.ts.map +1 -0
  67. package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.fr.js +29 -0
  68. package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.fr.js.map +1 -0
  69. package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.en.d.ts +1 -0
  70. package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.en.d.ts.map +1 -1
  71. package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.en.js +2 -1
  72. package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.en.js.map +1 -1
  73. package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.fr.d.ts +1 -0
  74. package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.fr.d.ts.map +1 -1
  75. package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.fr.js +2 -1
  76. package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.fr.js.map +1 -1
  77. package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.en.d.ts +5 -2
  78. package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.en.d.ts.map +1 -1
  79. package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.en.js +5 -2
  80. package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.en.js.map +1 -1
  81. package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.fr.d.ts +5 -2
  82. package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.fr.d.ts.map +1 -1
  83. package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.fr.js +5 -2
  84. package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.fr.js.map +1 -1
  85. package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.en.d.ts +41 -0
  86. package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.en.d.ts.map +1 -0
  87. package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.en.js +41 -0
  88. package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.en.js.map +1 -0
  89. package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.fr.d.ts +41 -0
  90. package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.fr.d.ts.map +1 -0
  91. package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.fr.js +41 -0
  92. package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.fr.js.map +1 -0
  93. package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.en.d.ts +1 -0
  94. package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.en.d.ts.map +1 -1
  95. package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.en.js +2 -1
  96. package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.en.js.map +1 -1
  97. package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.fr.d.ts +1 -0
  98. package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.fr.d.ts.map +1 -1
  99. package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.fr.js +2 -1
  100. package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.fr.js.map +1 -1
  101. package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.en.d.ts +1 -0
  102. package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.en.d.ts.map +1 -1
  103. package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.en.js +2 -1
  104. package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.en.js.map +1 -1
  105. package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.fr.d.ts +1 -0
  106. package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.fr.d.ts.map +1 -1
  107. package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.fr.js +2 -1
  108. package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.fr.js.map +1 -1
  109. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.en.d.ts +1 -0
  110. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.en.d.ts.map +1 -1
  111. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.en.js +2 -1
  112. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.en.js.map +1 -1
  113. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.fr.d.ts +1 -0
  114. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.fr.d.ts.map +1 -1
  115. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.fr.js +2 -1
  116. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.fr.js.map +1 -1
  117. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.en.d.ts +2 -0
  118. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.en.d.ts.map +1 -1
  119. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.en.js +3 -1
  120. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.en.js.map +1 -1
  121. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.fr.d.ts +2 -0
  122. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.fr.d.ts.map +1 -1
  123. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.fr.js +3 -1
  124. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.fr.js.map +1 -1
  125. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_AUTH.en.d.ts +1 -1
  126. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_AUTH.en.js +1 -1
  127. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_AUTH.en.js.map +1 -1
  128. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_AUTH.fr.d.ts +1 -1
  129. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_AUTH.fr.js +1 -1
  130. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_AUTH.fr.js.map +1 -1
  131. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.en.d.ts +2 -0
  132. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.en.d.ts.map +1 -1
  133. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.en.js +3 -1
  134. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.en.js.map +1 -1
  135. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.fr.d.ts +3 -1
  136. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.fr.d.ts.map +1 -1
  137. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.fr.js +4 -2
  138. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.fr.js.map +1 -1
  139. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.en.d.ts +17 -0
  140. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.en.d.ts.map +1 -1
  141. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.en.js +18 -1
  142. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.en.js.map +1 -1
  143. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.fr.d.ts +17 -0
  144. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.fr.d.ts.map +1 -1
  145. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.fr.js +18 -1
  146. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.fr.js.map +1 -1
  147. package/dist/esm/i18n/composite_views/app.creation-conversation.fr.d.ts +206 -195
  148. package/dist/esm/i18n/composite_views/app.creation-conversation.fr.d.ts.map +1 -1
  149. package/dist/esm/i18n/composite_views/app.creation-conversation.fr.js +206 -195
  150. package/dist/esm/i18n/composite_views/app.creation-conversation.fr.js.map +1 -1
  151. package/dist/esm/i18n/composite_views/app.creation-dossier.fr.d.ts +10 -0
  152. package/dist/esm/i18n/composite_views/app.creation-dossier.fr.d.ts.map +1 -1
  153. package/dist/esm/i18n/composite_views/app.creation-dossier.fr.js +12 -2
  154. package/dist/esm/i18n/composite_views/app.creation-dossier.fr.js.map +1 -1
  155. package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.fr.d.ts +70 -0
  156. package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.fr.d.ts.map +1 -1
  157. package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.fr.js +70 -0
  158. package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.fr.js.map +1 -1
  159. package/dist/esm/i18n/resources/wildoApplicationActorTasks.fr.d.ts +12 -2
  160. package/dist/esm/i18n/resources/wildoApplicationActorTasks.fr.d.ts.map +1 -1
  161. package/dist/esm/i18n/resources/wildoApplicationActorTasks.fr.js +12 -2
  162. package/dist/esm/i18n/resources/wildoApplicationActorTasks.fr.js.map +1 -1
  163. package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.fr.d.ts +10 -0
  164. package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.fr.d.ts.map +1 -1
  165. package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.fr.js +10 -0
  166. package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.fr.js.map +1 -1
  167. package/dist/esm/i18n/resources/workbenchBuildDispatchPlan.fr.d.ts +25 -20
  168. package/dist/esm/i18n/resources/workbenchBuildDispatchPlan.fr.d.ts.map +1 -1
  169. package/dist/esm/i18n/resources/workbenchBuildDispatchPlan.fr.js +25 -20
  170. package/dist/esm/i18n/resources/workbenchBuildDispatchPlan.fr.js.map +1 -1
  171. package/dist/esm/i18n/resources/workbenchBuildPlanTasks.fr.d.ts +32 -32
  172. package/dist/esm/i18n/resources/workbenchBuildPlanTasks.fr.js +32 -32
  173. package/dist/esm/i18n/resources/workbenchBuildPlanTasks.fr.js.map +1 -1
  174. package/dist/esm/i18n/resources/workbenchBuildTaskRecords.fr.d.ts +65 -65
  175. package/dist/esm/i18n/resources/workbenchBuildTaskRecords.fr.js +65 -65
  176. package/dist/esm/i18n/resources/workbenchBuildTaskRecords.fr.js.map +1 -1
  177. package/dist/esm/i18n/resources/workbenchDossierEntries.fr.d.ts +20 -0
  178. package/dist/esm/i18n/resources/workbenchDossierEntries.fr.d.ts.map +1 -1
  179. package/dist/esm/i18n/resources/workbenchDossierEntries.fr.js +20 -0
  180. package/dist/esm/i18n/resources/workbenchDossierEntries.fr.js.map +1 -1
  181. package/dist/esm/i18n/resources/workbenchGovernanceQuestions.fr.d.ts +12 -0
  182. package/dist/esm/i18n/resources/workbenchGovernanceQuestions.fr.d.ts.map +1 -1
  183. package/dist/esm/i18n/resources/workbenchGovernanceQuestions.fr.js +13 -1
  184. package/dist/esm/i18n/resources/workbenchGovernanceQuestions.fr.js.map +1 -1
  185. package/dist/esm/i18n/system_enums/application-creation.fr.d.ts +170 -170
  186. package/dist/esm/i18n/system_enums/application-creation.fr.js +170 -170
  187. package/dist/esm/i18n/system_enums/application-creation.fr.js.map +1 -1
  188. package/dist/esm/i18n/system_enums/flows-actors.fr.d.ts +22 -22
  189. package/dist/esm/i18n/system_enums/flows-actors.fr.js +22 -22
  190. package/dist/esm/i18n/system_enums/flows-actors.fr.js.map +1 -1
  191. package/dist/esm/i18n/system_enums/run-records.fr.d.ts +21 -21
  192. package/dist/esm/i18n/system_enums/run-records.fr.js +21 -21
  193. package/dist/esm/i18n/system_enums/run-records.fr.js.map +1 -1
  194. package/dist/esm/i18n/system_enums/workbench-build.en.d.ts +1 -0
  195. package/dist/esm/i18n/system_enums/workbench-build.en.d.ts.map +1 -1
  196. package/dist/esm/i18n/system_enums/workbench-build.en.js +1 -0
  197. package/dist/esm/i18n/system_enums/workbench-build.en.js.map +1 -1
  198. package/dist/esm/i18n/system_enums/workbench-build.fr.d.ts +37 -33
  199. package/dist/esm/i18n/system_enums/workbench-build.fr.d.ts.map +1 -1
  200. package/dist/esm/i18n/system_enums/workbench-build.fr.js +37 -33
  201. package/dist/esm/i18n/system_enums/workbench-build.fr.js.map +1 -1
  202. package/dist/esm/i18n/system_enums/workbench-creation-home.en.d.ts +1 -0
  203. package/dist/esm/i18n/system_enums/workbench-creation-home.en.d.ts.map +1 -1
  204. package/dist/esm/i18n/system_enums/workbench-creation-home.en.js +1 -0
  205. package/dist/esm/i18n/system_enums/workbench-creation-home.en.js.map +1 -1
  206. package/dist/esm/i18n/system_enums/workbench-creation-home.fr.d.ts +18 -17
  207. package/dist/esm/i18n/system_enums/workbench-creation-home.fr.d.ts.map +1 -1
  208. package/dist/esm/i18n/system_enums/workbench-creation-home.fr.js +18 -17
  209. package/dist/esm/i18n/system_enums/workbench-creation-home.fr.js.map +1 -1
  210. package/dist/esm/i18n/system_enums/workbench-dossier.fr.d.ts +7 -5
  211. package/dist/esm/i18n/system_enums/workbench-dossier.fr.d.ts.map +1 -1
  212. package/dist/esm/i18n/system_enums/workbench-dossier.fr.js +8 -6
  213. package/dist/esm/i18n/system_enums/workbench-dossier.fr.js.map +1 -1
  214. package/dist/esm/i18n/system_enums/workbench-secrets.fr.d.ts +12 -12
  215. package/dist/esm/i18n/system_enums/workbench-secrets.fr.js +12 -12
  216. package/dist/esm/i18n/system_enums/workbench-secrets.fr.js.map +1 -1
  217. package/dist/esm/i18n/system_enums/workbench-specification-artifact.fr.d.ts +1 -0
  218. package/dist/esm/i18n/system_enums/workbench-specification-artifact.fr.d.ts.map +1 -1
  219. package/dist/esm/i18n/system_enums/workbench-specification-artifact.fr.js +2 -1
  220. package/dist/esm/i18n/system_enums/workbench-specification-artifact.fr.js.map +1 -1
  221. package/dist/esm/i18n-labelling/services/labelling-planner.companion.service.d.ts.map +1 -1
  222. package/dist/esm/i18n-labelling/services/labelling-planner.companion.service.js +3 -4
  223. package/dist/esm/i18n-labelling/services/labelling-planner.companion.service.js.map +1 -1
  224. package/dist/esm/i18n-labelling/utils/declared-refusal-codes.utils.d.ts +11 -0
  225. package/dist/esm/i18n-labelling/utils/declared-refusal-codes.utils.d.ts.map +1 -1
  226. package/dist/esm/i18n-labelling/utils/declared-refusal-codes.utils.js +21 -0
  227. package/dist/esm/i18n-labelling/utils/declared-refusal-codes.utils.js.map +1 -1
  228. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts +120 -16
  229. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts.map +1 -1
  230. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js +875 -191
  231. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js.map +1 -1
  232. package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.d.ts +102 -13
  233. package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.d.ts.map +1 -1
  234. package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.js +243 -57
  235. package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.js.map +1 -1
  236. package/dist/esm/meta-workflows/services/application-build-landing-projection.companion.d.ts +3 -3
  237. package/dist/esm/meta-workflows/services/application-build-landing-projection.companion.js +3 -3
  238. package/dist/esm/meta-workflows/services/application-build-landing-projection.companion.js.map +1 -1
  239. package/dist/esm/meta-workflows/services/application-build-task-closure.companion.d.ts +9 -0
  240. package/dist/esm/meta-workflows/services/application-build-task-closure.companion.d.ts.map +1 -1
  241. package/dist/esm/meta-workflows/services/application-build-task-closure.companion.js +19 -0
  242. package/dist/esm/meta-workflows/services/application-build-task-closure.companion.js.map +1 -1
  243. package/dist/esm/meta-workflows/services/creation-intervention-ledger.companion.service.d.ts.map +1 -1
  244. package/dist/esm/meta-workflows/services/creation-intervention-ledger.companion.service.js +4 -5
  245. package/dist/esm/meta-workflows/services/creation-intervention-ledger.companion.service.js.map +1 -1
  246. package/dist/esm/meta-workflows/services/foundation-executor.companion.service.d.ts.map +1 -1
  247. package/dist/esm/meta-workflows/services/foundation-executor.companion.service.js +6 -3
  248. package/dist/esm/meta-workflows/services/foundation-executor.companion.service.js.map +1 -1
  249. package/dist/esm/meta-workflows/services/playbook-run-write-register-window.companion.d.ts.map +1 -1
  250. package/dist/esm/meta-workflows/services/playbook-run-write-register-window.companion.js +3 -5
  251. package/dist/esm/meta-workflows/services/playbook-run-write-register-window.companion.js.map +1 -1
  252. package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts +1 -1
  253. package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts.map +1 -1
  254. package/dist/esm/meta-workflows/services/playbook-run.companion.service.js +38 -21
  255. package/dist/esm/meta-workflows/services/playbook-run.companion.service.js.map +1 -1
  256. package/package.json +18 -18
@@ -1 +1 @@
1
- {"version":3,"file":"labelling-planner.companion.service.js","sourceRoot":"","sources":["../../../../src/i18n-labelling/services/labelling-planner.companion.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,cAAc,EACd,eAAe,EACf,oBAAoB,EAGpB,4BAA4B,EAC5B,aAAa,EACb,SAAS,EACT,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,qBAAqB,EACrB,2BAA2B,EAC3B,qCAAqC,EACrC,2CAA2C,EAC3C,6CAA6C,EAC7C,mBAAmB,GAGpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,kBAAkB,EAClB,+BAA+B,EAC/B,yCAAyC,EACzC,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AAKpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EACL,iCAAiC,EAIjC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KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC;SACzB,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AAChE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,4BAA4B,CAC1C,IAAuB,EACvB,OAAiD;AACjD,kGAAkG;AAClG,gBAAyE;IAEzE,IAAI,MAAM,GAAG,OAAO,CAAC;IACrB,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,WAAW,GAAG,gBAAgB,EAAE,CAAC,GAAG,CAAC,CAAC;QAC5C,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QACvD,MAAM,GAAG,EAAE,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,WAAW,EAAE,EAAE,CAAC;IACnF,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,OAAO,CAAC,KAAa;IAC5B,OAAO,KAAK,CAAC,OAAO,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAC;AAChD,CAAC;AAED,SAAS,eAAe,CAAC,KAAsB;IAC7C,MAAM,GAAG,GAA2B,EAAE,CAAC;IACvC,KAAK,MAAM,CAAC,IAAI,KAAK;QAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACpE,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import * as path from 'node:path';\nimport { inject, injectable, optional } from 'inversify';\nimport { z } from 'zod';\nimport {\n LabellingTypes,\n LabellingPolicy,\n additionalLabelsRefs,\n type LabellingUnitaryDef,\n type LabelParamDef,\n getRegisteredComponentLabels,\n LabelAudience,\n LabelKind,\n AuthResponseMessageRef,\n ResourceOperationTextSlot,\n} from '@wildo-ai/presets-components-models';\nimport {\n CoreResourceOperation,\n ErrorCustomMessageReference,\n FrontendNotificationCustomMessageRefs,\n FRONTEND_NOTIFICATION_CUSTOM_MESSAGE_PARAMS,\n FRONTEND_NOTIFICATION_CUSTOM_MESSAGE_PURPOSES,\n ERROR_GUIDANCE_REFS,\n type AnyResourceConfiguration,\n type GuidanceFlowDefinition,\n} from '@wildo-ai/saas-models';\nimport {\n SAAS_SERVICE_TYPES,\n ResourcesRegistryBackendService,\n resolveFeatureGatedCoreResourceExclusions,\n describeCaughtError,\n} from '@wildo-ai/saas-backend-lib';\nimport type {\n AppConfigurationService,\n LoggerService,\n} from '@wildo-ai/saas-backend-lib';\nimport { COMPANION_SERVICE_TYPES } from '../../core/inject/models/service-types';\nimport {\n LabellingPlanIncompletenessReason,\n type LabellingMilestoneDefinition,\n type LabellingProductDefinition,\n type LabellingFeatureDefinition,\n LabellingUnitCategory,\n MAX_ITEMS_PER_CHUNK,\n type LabellingPlanIncompleteness,\n type LabellingPlanResult,\n type LabellingUnit,\n type LabellingUnitChunk,\n type LabelKeyMeta,\n} from '../models/labelling-unit.models';\nimport { LabellingSpecContextLoaderCompanionService } from './labelling-spec-context-loader.companion.service';\nimport { planResourceSectionLabelKeys } from '../utils/resource-section-label-keys.utils';\nimport { resolveFrontendPlanDegradation } from '../utils/incomplete-plan-refusal.utils';\nimport { ComponentLabelsBootstrapCompanionService } from './component-labels-bootstrap.companion.service';\nimport {\n extractResourceFieldKeys,\n buildEphemeralFieldKeyMeta,\n buildSystemEnumLabelKeys,\n collectApplicationConfigSystemEnumVocabularies,\n type ApplicationConfigVocabularySources,\n} from '../utils/schema-fields-extractor.utils';\nimport { collectAppGuidanceKeys, collectResourceGuidanceKeys, resolveAppLevelGuidanceLabelKeys } from '../utils/guidance-keys.utils';\nimport {\n type FrontendDerivedLabelKeys,\n EMPTY_FRONTEND_DERIVED_LABEL_KEYS,\n parseFrontendDerivedLabelSnapshot,\n} from '../utils/frontend-derived-label-keys.utils';\nimport {\n ROLE_LABELLING_UNIT_FILE_PATH_HINT,\n collectRoleKeys,\n collectLifecycleKeys,\n} from '../utils/role-lifecycle-keys.utils';\nimport type { CompanionContext } from '../../core/context/companion-context';\nimport { CompanionIntrospectionService } from '../../core/introspection/services/companion-introspection.companion.service';\nimport { APPROVAL_SEAL_MANIFESTATION_WORDS, APPROVAL_SEAL_VERIFICATION_PAGE_WORDS, AppFrontendType, ApplicationConfigVocabulary, CORE_FEATURE_DEFINITIONS, FLOWS_ACTORS_TOOLS_LABEL_BUCKET, FeatureValueType, approvalSealManifestationWordKey, approvalSealVerificationPageWordKey, isLabelKeySegment, type ApprovalSealManifestationWord, type ApprovalSealManifestationWordDeclaration, type ApprovalSealVerificationPageWord } from '@wildo-ai/saas-models';\nimport { ENGINE_PAGE_METADATA } from '@wildo-ai/saas-frontend-lib/companion';\nimport { refusalLabelKey } from '../utils/declared-refusal-codes.utils';\nimport { collectSmsNotificationLabelKeys } from '../utils/sms-notification-label-keys.utils';\nimport {\n PROVIDERS_LABEL_BUCKET,\n planProviderDisplayNameKeys,\n readDeclaredProviderRefs,\n type DeclaredProviderRefsReading,\n} from '../utils/provider-display-name-keys.utils';\nimport {\n planProviderConnectionParameterKeys,\n planProviderVendorRegistrationStepKeys,\n planProviderCredentialFieldKeys,\n readDeclaredProviderCredentialFields,\n type DeclaredProviderCredentialField,\n type DeclaredProviderVendorRegistrationStep,\n type DeclaredProviderCredentialFieldsReading,\n} from '../utils/provider-credential-field-keys.utils';\nimport {\n SYSTEMS_OF_RECORD_LABEL_BUCKET,\n planSystemOfRecordDisplayNameKeys,\n readDeclaredSystemOfRecordInstances,\n} from '../utils/system-of-record-display-name-keys.utils';\nimport { applicationResourceWords, planFunctionToolLabelKeys, readDeclaredFunctionTools, type DeclaredFunctionTool } from '../utils/function-tool-label-keys.utils';\nimport { readPerUnitLabels, resolveApplicationI18nRoot } from '../utils/per-unit-file.utils';\nimport { getCompanionConfiguredPrimaryLanguage } from '../../core/config/primary-language.companion.utils';\nimport { AUDIT_PAYLOAD_FIELDS_LABEL_BUCKET, planAuditPayloadFieldLabelKeys } from '../utils/audit-payload-field-label-keys.utils';\nimport {\n applicationLabelVocabularyResources,\n classifyLabellingResourceProvenance,\n isCompanionOnlyResourceType,\n orderLabellingUnitsByVisibility,\n resourceLabellingUnitId,\n resourceLabellingUnitSlug,\n} from '../utils/application-label-vocabulary.utils';\n\n/** Static identity of one frontend-derived label family (see `FRONTEND_DERIVED_FAMILIES`). */\ninterface FrontendDerivedFamilyDescriptor {\n category: LabellingUnitCategory;\n id: string;\n displayLabel: string;\n bucket: string;\n prefix: string;\n}\n\n/**\n * The label families that exist ONLY if the frontend key snapshot could be\n * collected — their ref space is authored in the frontend app and cannot be\n * enumerated from any backend registry.\n *\n * Hoisted out of `planFrontendDerivedUnits` so that\n * {@link FRONTEND_DERIVED_LABEL_BUCKETS} — the list a degraded run reports as\n * unjudgeable — is DERIVED from the same descriptors the units are built from.\n * A hand-kept second copy would rot the day a fifth family is added, and it\n * would rot in the dangerous direction: a bucket missing from the suppression\n * list is a bucket an orphan report would happily condemn.\n */\nconst FRONTEND_DERIVED_FAMILIES: readonly FrontendDerivedFamilyDescriptor[] = [\n {\n category: LabellingUnitCategory.COMPOSITE_VIEW,\n id: 'composite-views:root',\n displayLabel: 'composite views',\n bucket: 'composite_views',\n prefix: `${LabellingTypes.COMPOSITE_VIEWS}.`,\n },\n {\n category: LabellingUnitCategory.VIEW,\n id: 'views:root',\n displayLabel: 'navigation views',\n bucket: 'views',\n prefix: `${LabellingTypes.VIEWS}.`,\n },\n {\n category: LabellingUnitCategory.SIDEBAR_SECTIONS_ROOT,\n id: 'sidebar-sections:root',\n displayLabel: 'sidebar sections',\n bucket: 'sidebar_sections',\n prefix: `${LabellingTypes.SIDEBAR_SECTIONS}.`,\n },\n {\n // Settings Hub rail labels — the application's authored categories and\n // placed sections.\n //\n // `keyMeta` comes from the SUBPROCESS (`derived.settingsHubKeyMeta`),\n // not from a spec registry like its three siblings: the authored wording\n // lives in the application's own `settings-hub.config.ts` and in the\n // engine destination catalog, neither of which the spec loader reads.\n // Threading it is not cosmetic — a generated key WINS over the authored\n // fallback in `tSettingsHubSection`, so a prompt working from the ref\n // alone silently REPLACES the rail's wording (measured on Wonder CRM\n // 2026-08-30: \"User provisioning\" → \"SCIM\", \"Audit streaming\" → \"SIEM\").\n category: LabellingUnitCategory.SETTINGS_HUB_ROOT,\n id: 'settings-hub:root',\n displayLabel: 'settings hub sections',\n bucket: 'settings_hub',\n prefix: `${LabellingTypes.SETTINGS_HUB}.`,\n },\n {\n // The command menu's application-defined category headings (#3122): `collectCommandCategoryLabelKeys`.\n category: LabellingUnitCategory.COMMAND_CATEGORIES_ROOT,\n id: 'command-categories:root',\n displayLabel: 'command menu categories',\n bucket: 'command_categories',\n prefix: `${LabellingTypes.COMMAND_CATEGORIES}.`,\n },\n];\n\n/**\n * The `filePathHint.bucket` values a failed frontend introspection suppresses.\n * Derived — never authored — from {@link FRONTEND_DERIVED_FAMILIES}.\n */\nexport const FRONTEND_DERIVED_LABEL_BUCKETS: readonly string[] = FRONTEND_DERIVED_FAMILIES.map(\n (family) => family.bucket,\n);\n\n/**\n * What the writer is told about the engine's notices, by key.\n *\n * - The declared PARAMETERS (`FRONTEND_NOTIFICATION_CUSTOM_MESSAGE_PARAMS`, #2813), on their `msg` keys: the names seed\n * the placeholders the drift validator checks, and the meanings tell the writer what each names.\n * - The declared PURPOSE (`FRONTEND_NOTIFICATION_CUSTOM_MESSAGE_PURPOSES`, #3148), on the `msg` and `nextStepLabel` keys:\n * what the notice says and to whom. Without it the writer had only the key name, and every reviewer's deadline notice\n * came out as \"Your request was not claimed in time\".\n *\n * Only keys the plan holds get an entry; an application's own notices (`userNotifications` on its operations) declare\n * neither and keep none.\n */\nexport function notificationsCustomKeyParams(keys: string[]): { keys: string[]; keyParams: Record<string, string[]>; keyMeta: Record<string, LabelKeyMeta> } {\n const keyParams: Record<string, string[]> = {};\n const keyMeta: Record<string, LabelKeyMeta> = {};\n const planned = new Set(keys);\n for (const [ref, purpose] of Object.entries(FRONTEND_NOTIFICATION_CUSTOM_MESSAGE_PURPOSES)) {\n const message = `${LabellingTypes.NOTIFICATIONS_CUSTOM}.${ref}.msg`;\n const nextStep = `${LabellingTypes.NOTIFICATIONS_CUSTOM}.${ref}.nextStepLabel`;\n if (planned.has(message)) keyMeta[message] = { purpose: `${purpose} This key is the notice's message.` };\n if (planned.has(nextStep)) keyMeta[nextStep] = { purpose: `${purpose} This key is the label of the notice's button, which opens what the notice is about.` };\n }\n for (const [ref, meanings] of Object.entries(FRONTEND_NOTIFICATION_CUSTOM_MESSAGE_PARAMS)) {\n const key = `${LabellingTypes.NOTIFICATIONS_CUSTOM}.${ref}.msg`;\n if (!meanings || !planned.has(key)) continue;\n keyParams[key] = Object.keys(meanings);\n keyMeta[key] = { ...keyMeta[key], paramMeanings: meanings };\n }\n return { keys, keyParams, keyMeta };\n}\n\n/**\n * Plans the labelling work as a flat list of `LabellingUnit`s.\n *\n * Responsibilities:\n * - Walk every source of labels (components registry, resource registry,\n * theme catalogs, milestones, billing, roles, lifecycle, guidance,\n * backend messages, additional refs).\n * - Group keys by unit + sub-group (so one component / one resource /\n * one theme bucket = one unit).\n * - Chunk each sub-group at `MAX_ITEMS_PER_CHUNK` so each LLM call stays\n * bounded (and the structured-output schema fits).\n * - Provide a lazy `loadSpecContext` that the orchestrator triggers\n * only when a unit is actually about to be sent to the LLM.\n *\n * This service is purely a planner — it does NOT generate, write, or\n * translate anything. The orchestrators consume `LabellingUnit[]` and\n * decide what to do (labellize / translate / skip based on the lock).\n */\n@injectable()\nexport class LabellingPlannerCompanionService {\n private readonly logDebug: (message: string, context?: Record<string, unknown>) => void;\n private guidanceFlowProvider: () => ReadonlyArray<GuidanceFlowDefinition> = () => [];\n private guidanceFlowProviderRegistered = false;\n\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.ResourceRegistryService) private readonly resourcesRegistryService: ResourcesRegistryBackendService,\n @inject(COMPANION_SERVICE_TYPES.LabellingSpecContextLoader) private readonly specContextLoader: LabellingSpecContextLoaderCompanionService,\n @inject(COMPANION_SERVICE_TYPES.ComponentLabelsBootstrapService) private readonly componentLabelsBootstrap: ComponentLabelsBootstrapCompanionService,\n @inject(COMPANION_SERVICE_TYPES.CompanionContext) private readonly companionContext: CompanionContext,\n @inject(COMPANION_SERVICE_TYPES.IntrospectionService) private readonly introspectionService: CompanionIntrospectionService,\n // #1921 — the application's configuration, for vocabularies whose values it declares there (reason codes).\n @inject(SAAS_SERVICE_TYPES.AppConfigService) @optional() private readonly appConfigService?: AppConfigurationService,\n ) {\n this.logDebug = this.logger.debugByType('LabellingPlannerService');\n }\n\n /**\n * Wire the app-level guidance-flow provider (OVERRIDE owner for app-level\n * `module.guidanceFlows` labels). When an app registers a provider the planner\n * trusts it as the single source of guidance-flow keys. When NO provider is\n * registered the planner falls back to frontend-module discovery (the\n * `frontend-labels-needed-info` behavior), so app-level guidance-flow labels\n * are still generated. Onboarding-view labels always come from discovery\n * regardless — they are not part of this provider contract.\n */\n public setGuidanceFlowProvider(provider: () => ReadonlyArray<GuidanceFlowDefinition>): void {\n this.guidanceFlowProvider = provider;\n this.guidanceFlowProviderRegistered = true;\n }\n\n /**\n * Plan all units in dependency-free order.\n *\n * Hydrates the decentralized component-labels registry on first call\n * (via static `.tsx` scan, no module loading). Idempotent — subsequent\n * calls are cheap.\n */\n public async planAllUnits(): Promise<LabellingUnit[]> {\n return (await this.planAllUnitsWithCompleteness()).units;\n }\n\n /**\n * `planAllUnits()` plus the explicit answer to \"was every family able to\n * enumerate itself?\".\n *\n * Generation only ever needs the units — a family that could not answer\n * contributes no work and the run proceeds, which is why `planAllUnits()`\n * exists and stays the default. Any consumer that reasons about ABSENCE\n * (nothing planned this bucket ⇒ the bucket is stale) needs the second half,\n * because the two situations produce a byte-identical unit list: an\n * application with no composite views, and an application whose frontend\n * introspection could not run. See `LabellingPlanIncompletenessReason`.\n */\n public async planAllUnitsWithCompleteness(): Promise<LabellingPlanResult> {\n await this.componentLabelsBootstrap.hydrateOnce();\n // Plan from the specifications as they stand NOW, not as the companion first read them (#1115).\n await this.specContextLoader.refreshIfSpecificationsChanged();\n const incompleteness: LabellingPlanIncompleteness[] = [];\n\n // Run the frontend introspection subprocess ONCE per plan; both\n // `planFrontendDerivedUnits` and `planAppGuidanceUnit` consume the snapshot.\n const frontend = await this.collectFrontendDerivedLabelKeys();\n if (frontend.incompleteness) incompleteness.push(frontend.incompleteness);\n const frontendDerived = frontend.snapshot;\n // Partial only when the snapshot should have answered — see `resolveFrontendPlanDegradation`.\n const frontendPlanDegradation = resolveFrontendPlanDegradation(frontend.incompleteness);\n\n // Milestone and product DECLARATIONS come from ONE introspection snapshot, not from the runtime registries\n // `startApplication()` fills — see MILESTONE_INTROSPECTION_FAILED and PRODUCT_CATALOG_INTROSPECTION_FAILED. A zero\n // there is authoritative; only a failed (or stale) introspection degrades a family.\n const { milestones, products, declaredResourceTypes: listedResourceTypes } = await this.collectRegistryDeclarations();\n // Every application registers the engine's own resources (users, organizations…), so an EMPTY list is a registry\n // that failed to load in the subprocess, never an application with nothing to label: it reads as unreadable, or a\n // stale companion would compare against nothing and report itself current (#2504 review).\n const declaredResourceTypes = listedResourceTypes !== undefined && listedResourceTypes.length > 0 ? listedResourceTypes : undefined;\n if (milestones.incompleteness) incompleteness.push(milestones.incompleteness);\n if (products.incompleteness) incompleteness.push(products.incompleteness);\n // The same snapshot lists the resource types the application declares NOW (#2504): the boot-time registry can lag it.\n const staleRegistry = this.detectStaleResourceRegistry(declaredResourceTypes);\n if (staleRegistry) incompleteness.push(staleRegistry);\n if (declaredResourceTypes === undefined) {\n incompleteness.push({\n reason: LabellingPlanIncompletenessReason.RESOURCE_REGISTRY_UNREADABLE,\n detail: 'The resources-registry introspection did not answer with the resource types the application declares, so '\n + \"whether the companion's registry lags the application cannot be told. Repair the introspection (wildo context health) and run the labels again.\",\n suppressedBuckets: ['resources'],\n });\n }\n\n // An unreadable specification registry reads as \"no specification\" for every resource, which plans back every\n // description a specification decided against — see RESOURCE_SPECIFICATIONS_UNAVAILABLE.\n const specsLoadFailure = await this.specContextLoader.resourceSpecificationsLoadFailure();\n const specsIncompleteness: LabellingPlanIncompleteness | undefined = specsLoadFailure === undefined\n ? undefined\n : {\n reason: LabellingPlanIncompletenessReason.RESOURCE_SPECIFICATIONS_UNAVAILABLE,\n detail: `The resource-specification registry could not be loaded: ${specsLoadFailure}`,\n suppressedBuckets: ['resources'],\n };\n if (specsIncompleteness) incompleteness.push(specsIncompleteness);\n\n // The same for the composite-view registry (#3233): a section description is planned only when its specification\n // documents one, and an unreadable registry would plan them all, so the composite-views unit is tagged and refused.\n const compositeSpecsLoadFailure = await this.specContextLoader.compositeViewSpecificationsLoadFailure();\n const compositeSpecsIncompleteness: LabellingPlanIncompleteness | undefined = compositeSpecsLoadFailure === undefined\n ? undefined\n : {\n reason: LabellingPlanIncompletenessReason.COMPOSITE_VIEW_SPECIFICATIONS_UNAVAILABLE,\n detail: `The composite-view specification registry could not be loaded: ${compositeSpecsLoadFailure}`,\n suppressedBuckets: ['composite_views'],\n };\n if (compositeSpecsIncompleteness) incompleteness.push(compositeSpecsIncompleteness);\n\n // The same for the roles (#3258), asked before the plan reads the role registry: see `roleSpecificationsLoadFailure`.\n const roleSpecsLoadFailure = await this.specContextLoader.roleSpecificationsLoadFailure();\n const roleSpecsIncompleteness: LabellingPlanIncompleteness | undefined = roleSpecsLoadFailure === undefined\n ? undefined\n : {\n reason: LabellingPlanIncompletenessReason.ROLE_SPECIFICATIONS_UNAVAILABLE,\n detail: `The application's roles could not all be read: ${roleSpecsLoadFailure}`,\n suppressedBuckets: ['roles'],\n };\n if (roleSpecsIncompleteness) incompleteness.push(roleSpecsIncompleteness);\n\n // The pause states approval gates declare (#1864), worded in the `system_enums` theme unit. A failed read tags\n // that unit so no write prunes the pause-state words it could not see.\n const gates = await this.collectHumanDecisionGateDeclarations();\n if (gates.incompleteness) incompleteness.push(gates.incompleteness);\n\n // The application's own tools (#2551), worded in their own bucket. A failed read plans no unit and suppresses the\n // bucket, so the words already generated there are neither pruned nor reported as orphans.\n const functionTools = await this.collectFunctionToolDeclarations();\n if (functionTools.incompleteness) incompleteness.push(functionTools.incompleteness);\n\n // Vendor names (#1895): read once here, so the incompleteness and the unit come from the SAME reading.\n // A failed reading of either half also TAGS the providers unit (`providersPlanDegradation`): the bucket suppression\n // only spares orphan files, while the unit's own file is rewritten from its plan, so a partial plan would delete the\n // missing providers' words in the primary locale and translate would prune them in every other one (#3196 review).\n const providersPlanDegradation: LabellingPlanIncompletenessReason[] = [];\n const declaredProviders = this.readDeclaredProviderPopulation();\n if (declaredProviders.unreadable.length > 0) {\n providersPlanDegradation.push(LabellingPlanIncompletenessReason.PROVIDER_RUNTIME_ARTIFACTS_UNREADABLE);\n incompleteness.push({\n reason: LabellingPlanIncompletenessReason.PROVIDER_RUNTIME_ARTIFACTS_UNREADABLE,\n detail:\n 'Provider runtime artifact(s) could not be read, so vendor names may be missing for the providers they declare: ' +\n declaredProviders.unreadable.map((entry) => `${entry.kind} (${entry.path}): ${entry.detail}`).join('; ') +\n '. Run `wildo config sync`.',\n suppressedBuckets: [PROVIDERS_LABEL_BUCKET],\n });\n }\n // The words of each declared provider's typed credential fields (#3196), read for the SAME refs.\n const credentialFields = await this.collectProviderCredentialFields(declaredProviders.refs);\n if (credentialFields.unreadable !== undefined) {\n providersPlanDegradation.push(LabellingPlanIncompletenessReason.PROVIDER_CREDENTIAL_FIELDS_UNREADABLE);\n incompleteness.push({\n reason: LabellingPlanIncompletenessReason.PROVIDER_CREDENTIAL_FIELDS_UNREADABLE,\n detail: `The providers' credential fields could not all be read (${credentialFields.unreadable}), so a field's words may be missing. `\n + 'Run `wildo config sync` and `pnpm install`, then run the labels again.',\n suppressedBuckets: [PROVIDERS_LABEL_BUCKET],\n });\n }\n\n const plannedUnits: LabellingUnit[] = [\n ...this.planComponentUnits(),\n ...(await this.planResourceUnits(frontendDerived, frontendPlanDegradation, specsIncompleteness)),\n ...this.planErrorsMessagesUnit(),\n ...(await this.planErrorsRefusalsUnit()),\n ...this.planThemeUnits(gates),\n ...(await this.planFrontendDerivedUnits(frontendDerived, compositeSpecsIncompleteness)),\n ...this.planEnginePageUnits(),\n ...this.planMilestoneUnits(milestones.definitions),\n ...this.planBillingUnit(products.definitions, products.featureDefinitions),\n ...this.planProvidersUnit(declaredProviders.refs, credentialFields.fieldsByRef, providersPlanDegradation, credentialFields.connectionParameterNamesByRef, credentialFields.vendorRegistrationStepsByRef),\n ...this.planSystemsOfRecordUnit(),\n ...this.planAuditPayloadFieldsUnit(),\n ...(await this.planFlowsActorsToolsUnit(functionTools.tools)),\n ...(await this.planRolesUnit(roleSpecsIncompleteness)),\n ...this.planLifecycleUnit(),\n ...(await this.planAppGuidanceUnit(frontendDerived, frontendPlanDegradation)),\n ...this.planAdditionalUnit(),\n ];\n // Generation order is visibility order (#3232): what the application's author defined first, so a run cut short has\n // spent its time on the words a user of the application meets. Each family above keeps its own order inside a tier.\n const units = orderLabellingUnitsByVisibility(plannedUnits);\n this.logDebug('Planned units', {\n total: units.length,\n byCategory: countByCategory(units),\n incompleteness: incompleteness.map((entry) => entry.reason),\n });\n return { units, incompleteness };\n }\n\n // ================================================================\n // Frontend-derived label families (composite views, navigation views,\n // sidebar sections).\n //\n // These families are authored ENTIRELY in the frontend app\n // (composite/full-custom/flows-actors view components, the sidebar\n // `contentSections` config + per-module `sidebarSections`). Their label keys\n // can only be computed by loading the frontend modules — a Vite/`.ts` source\n // graph the companion MAIN process cannot import. The\n // `frontend-labels-needed-info` introspection behavior runs in the companion\n // SUBPROCESS (the one with the Node-bridge loader) and is the single source of\n // truth for frontend-derived label keys — see\n // `frontend-labels-needed-info.behavior.ts`.\n //\n // This method consumes ONLY the three frontend-ONLY namespaces below from the\n // snapshot's `appSpecificLabelKeys`. `resources.*` and resource-scoped\n // `guidance.*` are ALSO present in `appSpecificLabelKeys` but are DROPPED here\n // — they are materialized by `planResourceUnits` off the backend resources\n // registry (taking them here too would double-generate). The exception is a\n // field's description and tooltip keys, which only this snapshot can see;\n // `planResourceUnits` reads those from `appSpecificLabelKeys` itself\n // (`addFrontendFieldTextKeys`). App-level guidance\n // flows and onboarding views arrive on dedicated snapshot fields\n // (`appLevelGuidanceFlowLabelKeys` / `onboardingViewLabelKeys`) and are owned\n // by `planAppGuidanceUnit`, NOT here. `engine.pages.*` is framework-fixed and\n // sourced by `planEnginePageUnits`.\n // ================================================================\n\n private async planFrontendDerivedUnits(\n derived: FrontendDerivedLabelKeys,\n /** Set when the composite-view specifications could not be read (#3233): the composite-views unit is then refused. */\n compositeSpecificationsIncompleteness?: LabellingPlanIncompleteness,\n ): Promise<LabellingUnit[]> {\n const frontendKeys = derived.appSpecificLabelKeys;\n if (frontendKeys.length === 0) return [];\n\n const families: Array<FrontendDerivedFamilyDescriptor & { keyParams?: Record<string, string[]> }> =\n FRONTEND_DERIVED_FAMILIES.map((family) => ({\n ...family,\n // Custom execution-view labels carry interpolation params; thread them so\n // the labellize prompt enforces the placeholder contract (mirrors the\n // components bucket). chunkKeys applies each entry only to its own key.\n ...(family.category === LabellingUnitCategory.VIEW ? { keyParams: derived.viewLabelParams } : {}),\n // A composite view's own declared labels carry params too (#2263); absent from a stale snapshot.\n ...(family.category === LabellingUnitCategory.COMPOSITE_VIEW && derived.compositeViewLabelParams\n ? { keyParams: derived.compositeViewLabelParams }\n : {}),\n }));\n\n const units: LabellingUnit[] = [];\n for (const family of families) {\n const familyKeys = frontendKeys.filter((key) => key.startsWith(family.prefix));\n // A composite SECTION description is optional: planned only when its specification documents one.\n const keys = family.category === LabellingUnitCategory.COMPOSITE_VIEW\n ? await this.specContextLoader.filterUndocumentedCompositeSectionDescriptions(familyKeys)\n : familyKeys;\n if (keys.length === 0) continue;\n // Composite-view + non-composite-view (full-custom / flows-actors / chart /\n // execution) + sidebar-section title/description keys have authored per-slot\n // purposes in their spec registries — project them so the labellize prompt\n // carries real wording intent instead of the LLM inventing filler from the\n // ref alone.\n const keyMeta = family.category === LabellingUnitCategory.COMPOSITE_VIEW\n ? await this.specContextLoader.projectCompositeViewKeyMeta(keys)\n : family.category === LabellingUnitCategory.VIEW\n ? await this.specContextLoader.projectViewKeyMeta(keys)\n : family.category === LabellingUnitCategory.SIDEBAR_SECTIONS_ROOT\n ? await this.specContextLoader.projectSidebarSectionKeyMeta(keys)\n : family.category === LabellingUnitCategory.SETTINGS_HUB_ROOT\n ? Object.fromEntries(\n keys\n .filter(key => derived.settingsHubKeyMeta?.[key] !== undefined)\n .map(key => [key, { purpose: `Rail label for this settings destination. The application currently words it \"${derived.settingsHubKeyMeta?.[key]}\" — preserve that meaning and register; do not substitute the technical ref or an acronym.` }]),\n )\n : family.category === LabellingUnitCategory.COMMAND_CATEGORIES_ROOT\n ? Object.fromEntries(keys.map((key) => [key, {\n purpose: `Heading of one group in the command menu (Cmd+K): the commands or searched records the application files under the category \"${key.split('.')[1]}\". A short noun phrase naming what the group holds, as a menu heading; never the raw category ref or an abbreviation of it.`,\n }]))\n : undefined;\n // A view or composite label's declared `isCount` params (#2263) join whatever the specification\n // projected for the same key, so the generator writes plural forms for an application's own labels.\n const keyMetaWithCounts = family.category === LabellingUnitCategory.VIEW\n ? withDeclaredLabelCountParams(keys, keyMeta, derived.viewLabelCountParams)\n : family.category === LabellingUnitCategory.COMPOSITE_VIEW\n ? withDeclaredLabelCountParams(keys, keyMeta, derived.compositeViewLabelCountParams)\n : keyMeta;\n units.push({\n category: family.category,\n id: family.id,\n displayLabel: family.displayLabel,\n filePathHint: { bucket: family.bucket, slug: 'root' },\n chunks: chunkKeys(family.id, keys, family.keyParams, keyMetaWithCounts),\n // Keys carry enough semantics (translationRef / section ref) for the LLM\n // to label from the identifier even when no keyMeta is projected.\n loadSpecContext: async () => undefined,\n ...(family.category === LabellingUnitCategory.COMPOSITE_VIEW && compositeSpecificationsIncompleteness\n ? { plannedFromIncompleteInputs: [compositeSpecificationsIncompleteness.reason] }\n : {}),\n });\n }\n return units;\n }\n\n /**\n * Invoke the `frontend-labels-needed-info` introspection behavior against the\n * app frontend service and return its full key snapshot: `appSpecificLabelKeys`\n * plus the two dedicated app-level guidance fields\n * (`appLevelGuidanceFlowLabelKeys`, `onboardingViewLabelKeys`).\n *\n * Returns an EMPTY snapshot (with a logged warning) when there is no SAAS_APP\n * frontend service or the subprocess fails/returns a malformed payload —\n * frontend-derived labels are best-effort and must never take down the whole\n * plan (which also feeds backend-only label generation). Payload shaping +\n * stale-subprocess tolerance lives in `parseFrontendDerivedLabelSnapshot`.\n */\n private async collectFrontendDerivedLabelKeys(): Promise<{\n snapshot: FrontendDerivedLabelKeys;\n /** Set on EVERY degraded path — the three empty-snapshot returns below. */\n incompleteness?: LabellingPlanIncompleteness;\n }> {\n const appFrontendServiceKey = Object.entries(this.companionContext.servicesByKey)\n .find(([, service]) => service.frontendType === AppFrontendType.SAAS_APP)?.[0];\n\n if (!appFrontendServiceKey) {\n this.logDebug('No SAAS_APP frontend service found; skipping frontend-derived label keys.');\n return {\n snapshot: EMPTY_FRONTEND_DERIVED_LABEL_KEYS,\n incompleteness: {\n reason: LabellingPlanIncompletenessReason.FRONTEND_INTROSPECTION_NO_APP_SERVICE,\n detail: 'No SAAS_APP frontend service is configured.',\n suppressedBuckets: FRONTEND_DERIVED_LABEL_BUCKETS,\n },\n };\n }\n\n // Verified against the source (#2504 review): a cached snapshot predating a new sidebar section plans without it.\n const result = await this.introspectionService.requestInfo({\n serviceKey: appFrontendServiceKey,\n behavior: 'frontend-labels-needed-info',\n }, { verifyAgainstSource: true });\n\n if (!result.success) {\n const message = 'error' in result ? result.error.message : 'unknown error';\n this.logger.warn(\n `frontend-labels-needed-info introspection failed; frontend-derived labels skipped: ${message}`,\n { serviceKey: appFrontendServiceKey },\n );\n return {\n snapshot: EMPTY_FRONTEND_DERIVED_LABEL_KEYS,\n incompleteness: {\n reason: LabellingPlanIncompletenessReason.FRONTEND_INTROSPECTION_FAILED,\n detail: `frontend-labels-needed-info introspection failed on '${appFrontendServiceKey}': ${message}`,\n suppressedBuckets: FRONTEND_DERIVED_LABEL_BUCKETS,\n },\n };\n }\n\n const snapshot = parseFrontendDerivedLabelSnapshot(result.data);\n if (!snapshot) {\n this.logger.warn('frontend-labels-needed-info returned no appSpecificLabelKeys array; frontend-derived labels skipped.');\n return {\n snapshot: EMPTY_FRONTEND_DERIVED_LABEL_KEYS,\n incompleteness: {\n reason: LabellingPlanIncompletenessReason.FRONTEND_INTROSPECTION_MALFORMED,\n detail: `frontend-labels-needed-info on '${appFrontendServiceKey}' returned no appSpecificLabelKeys array.`,\n suppressedBuckets: FRONTEND_DERIVED_LABEL_BUCKETS,\n },\n };\n }\n\n return { snapshot };\n }\n\n // ================================================================\n // Components — one unit per FrontendComponentType\n // ================================================================\n\n private planComponentUnits(): LabellingUnit[] {\n const registry = getRegisteredComponentLabels();\n\n const units: LabellingUnit[] = [];\n for (const [componentType, defs] of registry.entries()) {\n const keys = defs\n .map((d) => (typeof d === 'string' ? d : d?.ref))\n .filter((k): k is string => typeof k === 'string' && k.length > 0)\n .map((subKey) => `${LabellingTypes.COMPONENTS}.${componentType}.${subKey}`);\n\n if (keys.length === 0) continue;\n\n // Thread each label's DECLARED interpolation params (full key → param\n // names) so the labellize prompt can instruct the agent to emit EXACTLY\n // those single-brace placeholders (root-cause fix for the historical\n // `{value}` drift) and the post-generation validator can flag mismatches.\n // Object-form params (`{ key, isLabelled, … }`) collapse to their `key`;\n // plain-string defs and defs without params contribute no entry.\n const keyParams: Record<string, string[]> = {};\n for (const d of defs) {\n if (typeof d === 'string' || !d?.ref || !d.params || d.params.length === 0) continue;\n const paramNames = d.params\n .map((p) => (typeof p === 'string' ? p : p?.key))\n .filter((p): p is string => typeof p === 'string' && p.length > 0);\n if (paramNames.length === 0) continue;\n keyParams[`${LabellingTypes.COMPONENTS}.${componentType}.${d.ref}`] = paramNames;\n }\n\n // Thread the enriched per-key SEMANTIC metadata (purpose / kind / per-param\n // meaning / notes) authored in the component's `.labels.ts` def, so the\n // labellize + translate prompts get authoritative per-key context instead\n // of name-inference. Sparse: only keys that authored metadata get an entry.\n const keyMeta: Record<string, LabelKeyMeta> = {};\n for (const d of defs) {\n if (typeof d === 'string' || !d?.ref) continue;\n const paramMeanings: Record<string, string> = {};\n for (const p of d.params ?? []) {\n if (typeof p !== 'string' && p?.key && p.meaning) paramMeanings[p.key] = p.meaning;\n }\n const countParams = readDeclaredCountParams(d.params);\n const meta: LabelKeyMeta = {\n ...(d.purpose ? { purpose: d.purpose } : {}),\n ...(d.kind ? { kind: d.kind } : {}),\n ...(Object.keys(paramMeanings).length > 0 ? { paramMeanings } : {}),\n ...(countParams.length > 0 ? { countParams } : {}),\n ...(d.notes && d.notes.length > 0 ? { notes: d.notes } : {}),\n };\n if (Object.keys(meta).length > 0) {\n keyMeta[`${LabellingTypes.COMPONENTS}.${componentType}.${d.ref}`] = meta;\n }\n }\n\n const registeredSubKeys = defs\n .map((d) => (typeof d === 'string' ? d : d?.ref))\n .filter((s): s is string => typeof s === 'string' && s.length > 0);\n\n units.push({\n category: LabellingUnitCategory.COMPONENT,\n id: `component:${componentType}`,\n displayLabel: componentType,\n filePathHint: { bucket: 'components', slug: slugify(componentType) },\n chunks: chunkKeys(componentType, keys, keyParams, keyMeta),\n loadSpecContext: () => this.specContextLoader.loadComponentContext(componentType, registeredSubKeys),\n });\n }\n return units;\n }\n\n // ================================================================\n // Resources — one unit per resource type. Sub-groups: header / operations\n // / emptyState / sections / wizardSteps / groups / fields-block-N.\n // Resource-attached guidance is folded into the resource unit.\n // ================================================================\n\n /**\n * @param frontendIncompleteness Set when the frontend snapshot is the EMPTY fallback of an\n * introspection that should have answered (failed or malformed — never \"no frontend service\", which\n * is complete). Every resource unit then carries it (`plannedFromIncompleteInputs`), because its\n * layout, description opt-in and empty-state secondary-action keys all come from that snapshot and\n * are silently absent.\n * @param specificationsIncompleteness Set when the resource-specification registry could not be loaded\n * (RESOURCE_SPECIFICATIONS_UNAVAILABLE). Every resource unit carries it too: which section and empty-state\n * descriptions to plan is read from the specification, and an unreadable registry would plan them all.\n */\n private async planResourceUnits(\n frontendDerived: FrontendDerivedLabelKeys,\n frontendIncompleteness?: LabellingPlanIncompleteness,\n specificationsIncompleteness?: LabellingPlanIncompleteness,\n ): Promise<LabellingUnit[]> {\n const plannedFromIncompleteInputs = [frontendIncompleteness, specificationsIncompleteness]\n .filter((entry): entry is LabellingPlanIncompleteness => entry !== undefined)\n .map((entry) => entry.reason);\n const registry = this.resourcesRegistryService.getResourcesRegistry();\n // The application's vocabulary only (#3231): the companion's registry also carries the workbench's and the platform\n // plane's resources, which have no surface in the application. Excluded by provenance, in the shared filter.\n const allResources = this.applicationLabelVocabulary(registry.resourceConfigurations as Record<string, AnyResourceConfiguration> | undefined);\n const applicationResourceTypes: ReadonlySet<string> = new Set(registry.applicationResourceTypes ?? []);\n\n const headerDefs = readDefs(LabellingPolicy[LabellingTypes.RESOURCES], 'header');\n const operationsDefs = readDefs(LabellingPolicy[LabellingTypes.RESOURCES], 'operations');\n const emptyStateDefs = readDefs(LabellingPolicy[LabellingTypes.RESOURCES], 'emptyState');\n const sectionDefs = readDefs(LabellingPolicy[LabellingTypes.RESOURCES_SECTIONS], 'section');\n const wizardStepDefs = readDefs(LabellingPolicy[LabellingTypes.RESOURCES_WIZARD_STEPS], 'section');\n const fieldDisplayDefs = readDefs(LabellingPolicy[LabellingTypes.RESOURCES_FIELDS], 'display');\n const fieldEditDefs = readDefs(LabellingPolicy[LabellingTypes.RESOURCES_FIELDS], 'edit');\n const frontendFieldTextKeys = groupFrontendFieldTextKeysByResource(frontendDerived.appSpecificLabelKeys);\n\n const units: LabellingUnit[] = [];\n\n for (const [resourceType, resourceConfig] of Object.entries(allResources)) {\n const subgroups: { id: string; keys: string[] }[] = [];\n\n const headerKeys = headerDefs.map((sub) => `${LabellingTypes.RESOURCES}.${resourceType}.header.${sub}`);\n if (headerKeys.length) subgroups.push({ id: 'header', keys: headerKeys });\n\n const opIds = Array.from(new Set((resourceConfig.operations || []).map((op) => String(op.operationIdentifier))));\n // Per-operation description OPT-IN. The frontend ui-behavior is the ONLY source of\n // `operationFrontendConfig.hasDescription` (the planner main process never sees\n // `operationFrontendConfig` — it carries React components). The subprocess surfaces\n // it via the dedicated `operationDescriptionOptIns` snapshot field (resourceType →\n // opIds). The policy (`operationsDefs`) stays title-only; each flagged op ALSO gets a\n // `.description` key here so it flows through `projectResourceKeyMeta` below for\n // spec-driven copy quality. This is the bridge that lets engine resources (e.g.\n // organizations) — whose ui-behavior the main process cannot import — opt operations\n // into a description. Emitted once, only by the planner (the frontend mirror's\n // `resources.*` keys are dropped), so nothing double-generates.\n const descriptionOptInOpIds = new Set(frontendDerived.operationDescriptionOptIns[resourceType] ?? []);\n const conditionalOpIds = new Set(\n (resourceConfig.operations || [])\n .filter((op) => typeof (op as { enabledCondition?: unknown }).enabledCondition === 'function')\n .map((op) => String(op.operationIdentifier)),\n );\n const opKeys: string[] = [];\n for (const opId of opIds) {\n for (const sub of operationsDefs) {\n opKeys.push(`${LabellingTypes.RESOURCES}.${resourceType}.operations.${opId}.${sub}`);\n }\n if (descriptionOptInOpIds.has(opId)) {\n opKeys.push(`${LabellingTypes.RESOURCES}.${resourceType}.operations.${opId}.${ResourceOperationTextSlot.DESCRIPTION}`);\n }\n // An operation that can be UNAVAILABLE (any variant declares an `enabledCondition`) owes the\n // sentence its action shows when someone asks why it cannot run. Planned from the resource\n // configuration itself, so a condition added tomorrow is planned by construction.\n if (conditionalOpIds.has(opId)) {\n opKeys.push(`${LabellingTypes.RESOURCES}.${resourceType}.operations.${opId}.${ResourceOperationTextSlot.UNAVAILABLE_REASON}`);\n }\n }\n if (opKeys.length) subgroups.push({ id: 'operations', keys: opKeys });\n\n // Empty-state labels apply ONLY to resources that render a collection view (where an\n // empty state can appear) — i.e. resources with a LIST or SEARCH operation. Emitting\n // them for non-collection resources (singletons, nested-only sub-resources, junctions)\n // is pure waste, so gate the whole subgroup on a collection op. Within it, gate per\n // sub-key:\n // - title → always (it falls back to a generic component label in\n // `ResourceEmptyState`, so collection resources keep their\n // resource-specific copy = quality preserved)\n // - description → only when the specification authors `emptyState.purpose` (see\n // `resolveEmptyStateDescriptionAuthored`); with nothing authored it could\n // only restate the header above it or the button beside it. No\n // specification → planned, as before.\n // - (no primary-action key: that action IS the CREATE operation and takes its title)\n // - secondaryActionLabel → only if the frontend declares a `secondaryAction` (the one\n // empty-state label with NO fallback; frontend-only fact bridged\n // via `emptyStateSecondaryActionRefs`)\n // All gates are fail-safe: a wrong skip degrades to a generic fallback, never a broken label.\n const hasCollectionOp =\n opIds.includes(CoreResourceOperation.LIST) || opIds.includes(CoreResourceOperation.SEARCH);\n if (hasCollectionOp) {\n const hasSecondaryActionLabel = frontendDerived.emptyStateSecondaryActionRefs.includes(resourceType);\n const descriptionAuthored = await this.specContextLoader.resolveEmptyStateDescriptionAuthored(resourceType);\n const emptyStateKeys = emptyStateDefs\n .filter((sub) => {\n if (sub === 'secondaryActionLabel') return hasSecondaryActionLabel;\n if (sub === 'description') return descriptionAuthored !== false;\n return true;\n })\n .map((sub) => `${LabellingTypes.RESOURCES}.${resourceType}.emptyState.${sub}`);\n if (emptyStateKeys.length) subgroups.push({ id: 'emptyState', keys: emptyStateKeys });\n }\n\n /*\n * Structural refs come from the SUBPROCESS BRIDGE, not from the registry.\n *\n * `layout.refs` is authored in the ui-behavior, which this process cannot import (it carries\n * React components) — exactly like `operationFrontendConfig.hasDescription` two blocks above.\n * Reading `resourceConfig.frontendConfiguration` here found `undefined` for every resource in\n * every application, so `sectionKeys` was always empty and NO SECTION, WIZARD STEP OR GROUP\n * HAS EVER BEEN LABELLED: measured 2026-09-18, 0 of 315 resource label units across both\n * dogfood applications carried a `sections` block, while `<Section>` resolves\n * `resources.{type}.sections.{ref}.title` and so rendered each raw ref as its own heading.\n *\n * The registry lookup is KEPT as the fallback rather than replaced. Where a materialized\n * config does carry the frontend configuration the two agree, and keeping it means a stale\n * subprocess degrades to today's behaviour instead of a new empty in a different place.\n */\n const layoutRefs = frontendDerived.resourceLayoutRefs[resourceType]\n ?? (resourceConfig as { frontendConfiguration?: { layout?: { refs?: { sections?: string[]; wizardSteps?: string[]; groups?: string[]; filterPresets?: string[] } } } })\n .frontendConfiguration?.layout?.refs;\n\n // A section's description is planned only when its specification documents one: the slot is\n // optional, and an undocumented description would be a model-invented sub-heading restating the\n // title. No specification → both slots, as before (nothing to read the decision from).\n const sectionsWithoutDescription = (layoutRefs?.sections?.length ?? 0) > 0\n ? await this.specContextLoader.resolveSectionRefsWithoutDescription(resourceType)\n : undefined;\n const sectionKeys = planResourceSectionLabelKeys({\n resourceType,\n sectionRefs: layoutRefs?.sections ?? [],\n slotKeys: sectionDefs,\n sectionsWithoutDescription,\n });\n if (sectionKeys.length) subgroups.push({ id: 'sections', keys: sectionKeys });\n\n const wizardKeys: string[] = [];\n for (const stepRef of layoutRefs?.wizardSteps ?? []) {\n for (const sub of wizardStepDefs) {\n wizardKeys.push(`${LabellingTypes.RESOURCES}.${resourceType}.wizardSteps.${stepRef}.${sub}`);\n }\n }\n if (wizardKeys.length) subgroups.push({ id: 'wizardSteps', keys: wizardKeys });\n\n const groupKeys: string[] = (layoutRefs?.groups ?? []).map(\n (gRef) => `${LabellingTypes.RESOURCES}.${resourceType}.groups.${gRef}.title`,\n );\n if (groupKeys.length) subgroups.push({ id: 'groups', keys: groupKeys });\n\n /*\n * Collection FILTER PRESETS — the pills above a list (\"Urgent\", \"Created today\").\n *\n * Same source and same reason as the three axes above: the refs are authored in the\n * ui-behavior (`views → collectionDisplayConfig.presetFilters`), which only the subprocess\n * can import, and a preset with no authored label renders its raw `ref` — so an unplanned\n * preset is a pill reading `created-today` in every locale.\n *\n * No registry fallback beside it, unlike `layoutRefs`: `presetFilters` is frontend-only and\n * has never been carried on `frontendConfiguration`, so there is no second place that could\n * agree or disagree.\n */\n const filterPresetKeys: string[] = (layoutRefs?.filterPresets ?? []).map(\n (presetRef) => `${LabellingTypes.RESOURCES}.${resourceType}.filterPresets.${presetRef}.label`,\n );\n if (filterPresetKeys.length) subgroups.push({ id: 'filterPresets', keys: filterPresetKeys });\n\n const fieldKeys = extractResourceFieldKeys({\n resourceType,\n resourceConfig,\n displayDefs: fieldDisplayDefs,\n editDefs: fieldEditDefs,\n });\n addFrontendFieldTextKeys(fieldKeys, frontendFieldTextKeys.get(resourceType));\n if (fieldKeys.length) subgroups.push({ id: 'fields', keys: fieldKeys });\n\n // Resource-attached guidance flows fold in under `guidance` subgroup\n // (resource-scoped). Root-level guidance lives in its own root unit.\n const resourceGuidanceKeys = collectResourceGuidanceKeys(resourceType, resourceConfig);\n if (resourceGuidanceKeys.length) subgroups.push({ id: 'guidance', keys: resourceGuidanceKeys });\n\n // Resource-attached milestones (milestones whose definition references\n // this resource) will be folded into the unit by Phase 2 once the\n // milestone-definition cross-index is exposed by the registry.\n\n // Project per-key meaning (kind + purpose) from the resource spec onto its\n // label keys — the resource analogue of the component `.labels.ts` keyMeta.\n const allKeys = subgroups.flatMap((sg) => sg.keys);\n const keyMeta = await this.specContextLoader.projectResourceKeyMeta(resourceType, allKeys);\n // Ephemeral fields (one-time secrets like an API key's `plainKey`) live only\n // in a customResponseDto, so the spec-driven projection above can't see them.\n // Project framework-general keyMeta from the `.isEphemeral()` marker itself —\n // a user-facing label (\"API key\", not \"Plain key\") + a \"copy it now, shown\n // once\" description — merged OVER the heuristic for those keys.\n Object.assign(keyMeta, buildEphemeralFieldKeyMeta({ resourceType, resourceConfig }));\n const chunks = subgroupsToChunks(resourceLabellingUnitId(resourceType), subgroups, keyMeta);\n if (chunks.length === 0) continue;\n\n units.push({\n category: LabellingUnitCategory.RESOURCE,\n id: resourceLabellingUnitId(resourceType),\n displayLabel: resourceType,\n filePathHint: { bucket: 'resources', slug: resourceLabellingUnitSlug(resourceType) },\n chunks,\n loadSpecContext: () => this.specContextLoader.loadResourceContext(resourceType),\n resourceProvenance: classifyLabellingResourceProvenance(resourceType, applicationResourceTypes),\n ...(plannedFromIncompleteInputs.length > 0 ? { plannedFromIncompleteInputs } : {}),\n });\n }\n return units;\n }\n\n // ================================================================\n // Themes — grouped buckets (errors_messages, errors_guidance, etc.)\n // ================================================================\n\n private planThemeUnits(gates: { pauseStates: readonly string[]; incompleteness?: LabellingPlanIncompleteness }): LabellingUnit[] {\n // `errors_guidance` is the one theme bucket that declares interpolation\n // params (e.g. `retryCountdown → [\"seconds\"]`); thread them so regeneration\n // seeds the placeholder and the drift validator covers it like components.\n const errorsGuidance = this.collectErrorsGuidanceKeys();\n // NOTE: `errors_messages` is intentionally NOT in this generic theme loop.\n // It has its own `planErrorsMessagesUnit()` so it can project per-ref\n // `purpose` + `audience` from the error-message specs (the theme loop is\n // deliberately audience-less / keyMeta-less for the other buckets).\n const themes: { themeId: string; keys: string[]; keyParams?: Record<string, string[]>; keyMeta?: Record<string, LabelKeyMeta> }[] = [\n { themeId: 'errors_guidance', keys: errorsGuidance.keys, keyParams: errorsGuidance.keyParams, keyMeta: errorsGuidance.keyMeta },\n { themeId: 'errors_validation', keys: this.collectErrorsValidationKeys() },\n { themeId: 'notifications_custom', ...this.collectNotificationsCustomTheme() },\n { themeId: 'system_enums', keys: this.collectSystemEnumsKeys(gates.pauseStates) },\n { themeId: 'backend_auth_messages', keys: this.collectBackendAuthMessagesKeys() },\n { themeId: 'backend_sms', keys: this.collectBackendSmsKeys() },\n { themeId: 'backend_documents', ...this.collectBackendDocumentsTheme() },\n ];\n\n const units: LabellingUnit[] = [];\n for (const { themeId, keys, keyParams, keyMeta } of themes) {\n if (keys.length === 0) continue;\n units.push({\n category: themeId.startsWith('backend_') ? LabellingUnitCategory.BACKEND_MESSAGES : LabellingUnitCategory.THEME,\n id: `theme:${themeId}`,\n displayLabel: themeId,\n filePathHint: { bucket: 'themes', slug: themeId },\n chunks: chunkKeys(themeId, keys, keyParams, keyMeta),\n loadSpecContext: async () => undefined,\n // The pause-state words live in `system_enums`: planned without them, the unit holds a subset (#1864).\n ...(themeId === 'system_enums' && gates.incompleteness ? { plannedFromIncompleteInputs: [gates.incompleteness.reason] } : {}),\n });\n }\n return units;\n }\n\n // ================================================================\n // Engine pages — one root unit listing the `i18nKey` of every engine\n // page enumerated in `ENGINE_PAGE_METADATA` (HOME, SECURITY_SETTINGS, …).\n //\n // Engine pages are framework-owned navigation targets; the metadata\n // record is the canonical source of truth for both routing and label\n // resolution (see `launcher-items.frontend.schemas.ts:ENGINE_PAGE_METADATA`).\n // The runtime label lookup uses `ctx.t(metadata.i18nKey)`, and the\n // i18n key itself is already a full dotted path (e.g.\n // `engine.pages.home`) — emit `<i18nKey>.title` per page.\n // ================================================================\n\n private planEnginePageUnits(): LabellingUnit[] {\n const entries = Object.values(ENGINE_PAGE_METADATA);\n if (entries.length === 0) return [];\n\n const keys: string[] = [];\n for (const metadata of entries) {\n keys.push(`${metadata.i18nKey}.title`);\n }\n\n return [{\n category: LabellingUnitCategory.ENGINE_PAGES_ROOT,\n id: 'engine-pages:root',\n displayLabel: 'engine pages',\n filePathHint: { bucket: 'engine_pages', slug: 'root' },\n chunks: chunkKeys('engine-pages', keys),\n // Engine pages have stable, app-agnostic semantics (Home, Security\n // Settings, …). The keys alone are enough for label generation;\n // rich context could be added later if app-specific tone is required.\n loadSpecContext: async () => undefined,\n }];\n }\n\n /**\n * The milestone and product DECLARATIONS, read from ONE `resources-registry` introspection of the application's\n * shared modules.\n *\n * Both families used to be planned from runtime registries — `MilestoneDefinitionRegistry` and\n * `ProductCatalogSyncBackendService` — whose only writer is `startApplication()`, which the companion never runs.\n * Each answered `[]` for every application, and the family disappeared with nothing reported: Wonder Todos declares\n * eight milestones and planned none (#1405), and no application ever had a plan name labelled (found by #1881's\n * regeneration).\n *\n * Reading declarations restores the distinction the old predicates claimed but could not have: an application that\n * declares no milestones or sells nothing answers an AUTHORITATIVE zero, and only a failed introspection degrades.\n * Each projection degrades on its own: a subprocess predating one projection carries the other.\n */\n private async collectRegistryDeclarations(): Promise<{\n milestones: { definitions: readonly LabellingMilestoneDefinition[]; incompleteness?: LabellingPlanIncompleteness };\n products: {\n definitions: readonly LabellingProductDefinition[];\n featureDefinitions: readonly LabellingFeatureDefinition[];\n incompleteness?: LabellingPlanIncompleteness;\n };\n /** The resource types the application declares NOW, read fresh by the subprocess (#2504); absent when it did not answer. */\n declaredResourceTypes?: readonly string[];\n }> {\n const milestoneDegraded = (detail: string) => {\n this.logger.warn(`Milestone label planning skipped: ${detail}`);\n return {\n definitions: [],\n incompleteness: { reason: LabellingPlanIncompletenessReason.MILESTONE_INTROSPECTION_FAILED, detail, suppressedBuckets: ['milestones'] },\n };\n };\n const productDegraded = (detail: string) => {\n this.logger.warn(`Billing label planning skipped: ${detail}`);\n return {\n definitions: [],\n featureDefinitions: [],\n incompleteness: { reason: LabellingPlanIncompletenessReason.PRODUCT_CATALOG_INTROSPECTION_FAILED, detail, suppressedBuckets: ['billing'] },\n };\n };\n\n const backendServiceKey = Object.entries(this.companionContext.servicesByKey)\n .find(([, service]) => !service.frontendType)?.[0];\n if (!backendServiceKey) {\n const detail = 'No backend service is configured to answer the resources-registry introspection.';\n return { milestones: milestoneDegraded(detail), products: productDegraded(detail) };\n }\n\n // Verified against the source, not a cached answer (#2504 review): the labels step decides from what this says is absent.\n const result = await this.introspectionService.requestInfo({\n serviceKey: backendServiceKey,\n behavior: 'resources-registry',\n }, { verifyAgainstSource: true });\n if (!result.success) {\n const message = 'error' in result ? result.error.message : 'unknown error';\n const detail = `resources-registry introspection failed on '${backendServiceKey}': ${message}`;\n return { milestones: milestoneDegraded(detail), products: productDegraded(detail) };\n }\n const data = result.data as { customMilestoneDefinitions?: unknown; productDefinitions?: unknown; customFeatureDefinitions?: unknown; resourceTypes?: unknown } | undefined;\n const declaredResourceTypes = Array.isArray(data?.resourceTypes)\n ? data.resourceTypes.filter((entry): entry is string => typeof entry === 'string')\n : undefined;\n\n // A snapshot produced BEFORE a projection existed carries no key for it. That is a stale subprocess, not an\n // application without milestones or products, so it degrades rather than reporting zero.\n const stale = (projection: string) =>\n `resources-registry on '${backendServiceKey}' returned no ${projection} array (a subprocess predating the projection, or a malformed payload).`;\n\n let milestones: { definitions: readonly LabellingMilestoneDefinition[]; incompleteness?: LabellingPlanIncompleteness };\n if (!Array.isArray(data?.customMilestoneDefinitions)) {\n milestones = milestoneDegraded(stale('customMilestoneDefinitions'));\n } else {\n const definitions: LabellingMilestoneDefinition[] = [];\n for (const entry of data.customMilestoneDefinitions) {\n const candidate = entry as Partial<LabellingMilestoneDefinition>;\n if (typeof candidate?.identifier !== 'string' || candidate.identifier.length === 0) continue;\n definitions.push({\n identifier: candidate.identifier,\n hasDescriptionLabel: candidate.hasDescriptionLabel === true,\n ...(typeof candidate.category === 'string' ? { category: candidate.category } : {}),\n });\n }\n this.logDebug(`Milestone declarations read from introspection: ${definitions.length}`);\n milestones = { definitions };\n }\n\n let products: {\n definitions: readonly LabellingProductDefinition[];\n featureDefinitions: readonly LabellingFeatureDefinition[];\n incompleteness?: LabellingPlanIncompleteness;\n };\n if (!Array.isArray(data?.productDefinitions)) {\n products = productDegraded(stale('productDefinitions'));\n } else if (!Array.isArray(data?.customFeatureDefinitions)) {\n // The same bucket: a feature's words live beside a plan's, so a plan read without the features is not total.\n products = productDegraded(stale('customFeatureDefinitions'));\n } else {\n const strings = (value: unknown): string[] => (Array.isArray(value) ? value.filter((item): item is string => typeof item === 'string') : []);\n const definitions: LabellingProductDefinition[] = [];\n for (const entry of data.productDefinitions) {\n const candidate = entry as Partial<LabellingProductDefinition>;\n if (typeof candidate?.key !== 'string' || candidate.key.length === 0) continue;\n definitions.push({\n key: candidate.key,\n grantedFeatures: strings(candidate.grantedFeatures),\n grantedLimitKeys: strings(candidate.grantedLimitKeys),\n ...(typeof candidate.creditPoolKey === 'string' && candidate.creditPoolKey.length > 0 ? { creditPoolKey: candidate.creditPoolKey } : {}),\n });\n }\n this.logDebug(`Product declarations read from introspection: ${definitions.length}`);\n products = { definitions, featureDefinitions: this.readDeclaredFeatureDefinitions(data.customFeatureDefinitions) };\n }\n\n return { milestones, products, ...(declaredResourceTypes === undefined ? {} : { declaredResourceTypes }) };\n }\n\n /**\n * The resource types the application declares that the companion's registry does not carry (#2504), as an\n * incompleteness. `undefined` when the two agree, or when the fresh list could not be read (nothing to compare).\n */\n private detectStaleResourceRegistry(declaredResourceTypes: readonly string[] | undefined): LabellingPlanIncompleteness | undefined {\n if (declaredResourceTypes === undefined) return undefined;\n const registered = new Set(Object.keys(this.resourcesRegistryService.getResourcesRegistry().resourceConfigurations ?? {}));\n const missing = declaredResourceTypes.filter((resourceType) => !registered.has(resourceType) && !isCompanionOnlyResourceType(resourceType));\n if (missing.length === 0) return undefined;\n return {\n reason: LabellingPlanIncompletenessReason.RESOURCE_REGISTRY_STALE,\n detail: `The companion's resource registry, loaded when it started, lacks ${missing.length} resource type(s) the application `\n + `now declares: ${missing.join(', ')}. Restart the companion so it reloads the application's registry, then run the labels again.`,\n suppressedBuckets: ['resources'],\n expectedUnitHints: missing.map((resourceType) => ({ bucket: 'resources', slug: resourceLabellingUnitSlug(resourceType) })),\n };\n }\n\n private planMilestoneUnits(definitions: readonly LabellingMilestoneDefinition[]): LabellingUnit[] {\n if (definitions.length === 0) return [];\n\n const keys: string[] = [];\n const uniqueCategories = new Set<string>();\n for (const def of definitions) {\n keys.push(`${LabellingTypes.MILESTONES}.${def.identifier}.title`);\n if (def.hasDescriptionLabel) keys.push(`${LabellingTypes.MILESTONES}.${def.identifier}.description`);\n if (def.category) uniqueCategories.add(def.category);\n keys.push(`${LabellingTypes.MILESTONES}.${def.identifier}.reward.title`);\n keys.push(`${LabellingTypes.MILESTONES}.${def.identifier}.reward.message`);\n }\n for (const cat of uniqueCategories) {\n keys.push(`${LabellingTypes.MILESTONES}.categories.${cat}.label`);\n }\n\n return [{\n category: LabellingUnitCategory.MILESTONES_ROOT,\n id: 'milestones:root',\n displayLabel: 'milestones',\n filePathHint: { bucket: 'milestones', slug: 'root' },\n chunks: chunkKeys('milestones', keys),\n loadSpecContext: async () => undefined,\n }];\n }\n\n /**\n * Every declared feature and limit (#1851): the engine's core definitions plus the application's own, as projected by\n * the introspection. A custom definition repeating a core identifier contributes nothing new.\n */\n private readDeclaredFeatureDefinitions(customDefinitions: readonly unknown[]): LabellingFeatureDefinition[] {\n const valueTypes = new Set<string>(Object.values(FeatureValueType));\n const declared = new Map<string, LabellingFeatureDefinition>();\n for (const definition of CORE_FEATURE_DEFINITIONS) {\n declared.set(definition.identifier, { identifier: definition.identifier, valueType: definition.valueType });\n }\n for (const entry of customDefinitions) {\n const candidate = entry as Partial<LabellingFeatureDefinition>;\n if (typeof candidate?.identifier !== 'string' || candidate.identifier.length === 0) continue;\n if (typeof candidate.valueType !== 'string' || !valueTypes.has(candidate.valueType)) continue;\n declared.set(candidate.identifier, { identifier: candidate.identifier, valueType: candidate.valueType });\n }\n this.logDebug(`Feature declarations: ${declared.size} (core and custom)`);\n return [...declared.values()];\n }\n\n /**\n * The billing words: each product's name, description and tagline, the words of every FEATURE and LIMIT, and each\n * credit pool's. Features and limits are planned from every declaration (`featureDefinitions`, #1851), and also from\n * a product's grants, so a grant naming an undeclared key is still worded rather than left raw.\n */\n private planBillingUnit(definitions: readonly LabellingProductDefinition[], featureDefinitions: readonly LabellingFeatureDefinition[]): LabellingUnit[] {\n if (definitions.length === 0 && featureDefinitions.length === 0) return [];\n\n const keys: string[] = [];\n const featureKeys = new Set<string>();\n const limitKeys = new Set<string>();\n const creditPoolKeys = new Set<string>();\n\n for (const feature of featureDefinitions) {\n if (feature.valueType === FeatureValueType.LIMIT) limitKeys.add(feature.identifier);\n else featureKeys.add(feature.identifier);\n }\n for (const def of definitions) {\n keys.push(`${LabellingTypes.BILLING_PRODUCTS}.${def.key}.name`);\n keys.push(`${LabellingTypes.BILLING_PRODUCTS}.${def.key}.description`);\n keys.push(`${LabellingTypes.BILLING_PRODUCTS}.${def.key}.tagline`);\n for (const f of def.grantedFeatures) featureKeys.add(f);\n for (const l of def.grantedLimitKeys) limitKeys.add(l);\n if (def.creditPoolKey) creditPoolKeys.add(def.creditPoolKey);\n }\n for (const f of featureKeys) {\n keys.push(`${LabellingTypes.BILLING_FEATURES}.${f}.label`);\n keys.push(`${LabellingTypes.BILLING_FEATURES}.${f}.description`);\n }\n for (const l of limitKeys) {\n keys.push(`${LabellingTypes.BILLING_LIMITS}.${l}.label`);\n keys.push(`${LabellingTypes.BILLING_LIMITS}.${l}.description`);\n keys.push(`${LabellingTypes.BILLING_LIMITS}.${l}.unit`);\n }\n for (const p of creditPoolKeys) {\n keys.push(`${LabellingTypes.BILLING_CREDIT_POOLS}.${p}.name`);\n keys.push(`${LabellingTypes.BILLING_CREDIT_POOLS}.${p}.description`);\n keys.push(`${LabellingTypes.BILLING_CREDIT_POOLS}.${p}.unit`);\n }\n\n return [{\n category: LabellingUnitCategory.BILLING,\n id: 'billing:root',\n displayLabel: 'billing',\n filePathHint: { bucket: 'billing', slug: 'root' },\n chunks: chunkKeys('billing', keys),\n loadSpecContext: async () => undefined,\n }];\n }\n\n /**\n * Vendor display names — `providers.<ref>.displayName` for every provider the application declares (#1895).\n *\n * One unit for the whole family: the keys are one-word brand names, so a unit per vendor would be dozens of model\n * calls for a few dozen words. The population and each key's intent are derived in\n * `provider-display-name-keys.utils.ts`; the ref is passed as intent, never as the word.\n */\n private readDeclaredProviderPopulation(): DeclaredProviderRefsReading {\n return readDeclaredProviderRefs(this.companionContext.saasRoot);\n }\n\n /**\n * The typed credential fields each declared provider publishes (#3196), read through provider discovery. See\n * `provider-credential-field-keys.utils.ts`. A seam, so a test plans the family without a real discovery walk.\n */\n private async collectProviderCredentialFields(refs: readonly string[]): Promise<DeclaredProviderCredentialFieldsReading> {\n return readDeclaredProviderCredentialFields({ saasRoot: this.companionContext.saasRoot, saasConfig: this.companionContext.saasConfig, refs });\n }\n\n /**\n * @param planDegradation The reasons either half of the population could not be read (an unreadable runtime artifact,\n * an unreadable provider discovery). Non-empty means the unit holds a SUBSET of its real keys, so it carries them as\n * `plannedFromIncompleteInputs` and every write path refuses it rather than prune the words it could not plan.\n */\n private planProvidersUnit(\n refs: readonly string[],\n credentialFieldsByRef: Readonly<Record<string, readonly DeclaredProviderCredentialField[]>> = {},\n planDegradation: readonly LabellingPlanIncompletenessReason[] = [],\n connectionParameterNamesByRef: Readonly<Record<string, readonly string[]>> = {},\n vendorRegistrationStepsByRef: Readonly<Record<string, readonly DeclaredProviderVendorRegistrationStep[]>> = {},\n ): LabellingUnit[] {\n const names = planProviderDisplayNameKeys(refs);\n // One unit for the vendor's words: its name, its credential fields' words (#3196) and its connection parameters'\n // words (#3251), one model call.\n const fields = planProviderCredentialFieldKeys(credentialFieldsByRef);\n const parameters = planProviderConnectionParameterKeys(connectionParameterNamesByRef);\n // And the vendor-registration steps an organization reads (#3252), each with the placeholders its words carry.\n const steps = planProviderVendorRegistrationStepKeys(vendorRegistrationStepsByRef);\n const keys = [...names.keys, ...fields.keys, ...parameters.keys, ...steps.keys];\n const keyMeta = { ...names.keyMeta, ...fields.keyMeta, ...parameters.keyMeta, ...steps.keyMeta };\n if (keys.length === 0) return [];\n return [{\n category: LabellingUnitCategory.PROVIDERS_ROOT,\n id: `${PROVIDERS_LABEL_BUCKET}:root`,\n displayLabel: 'provider names, connect-form fields and registration steps',\n filePathHint: { bucket: PROVIDERS_LABEL_BUCKET, slug: 'root' },\n chunks: chunkKeys(PROVIDERS_LABEL_BUCKET, keys, steps.keyParams, keyMeta),\n loadSpecContext: async () => ({ audience: LabelAudience.END_USER }),\n ...(planDegradation.length > 0 ? { plannedFromIncompleteInputs: [...planDegradation] } : {}),\n }];\n }\n\n /**\n * System-of-record instance names — `systems_of_record.<name>.displayName` for every instance the application declares\n * (#1997). One unit for the family, like the vendor names: a handful of names, one model call. The population is the\n * loaded saas configuration's `systemsOfRecord` block, and each key carries the name and vendor as intent only.\n */\n private planSystemsOfRecordUnit(): LabellingUnit[] {\n const { keys, keyMeta } = planSystemOfRecordDisplayNameKeys(\n readDeclaredSystemOfRecordInstances(this.companionContext.saasConfig?.systemsOfRecord),\n );\n if (keys.length === 0) return [];\n return [{\n category: LabellingUnitCategory.SYSTEMS_OF_RECORD_ROOT,\n id: `${SYSTEMS_OF_RECORD_LABEL_BUCKET}:root`,\n displayLabel: 'system-of-record names',\n filePathHint: { bucket: SYSTEMS_OF_RECORD_LABEL_BUCKET, slug: 'root' },\n chunks: chunkKeys(SYSTEMS_OF_RECORD_LABEL_BUCKET, keys, undefined, keyMeta),\n loadSpecContext: async () => ({ audience: LabelAudience.END_USER }),\n }];\n }\n\n /**\n * Typed audit payload field words — `audit_payload_fields.<path>.label` for every field path the engine's typed audit\n * payloads declare (#3168). Planned for every application, unconditionally, like the payload vocabularies: every\n * application records these events, and the audit log's payload card names each value it lists by this key. Chunked\n * like any large unit; each key carries the intent derived from the schemas (the events recording the field, the\n * shape of its value), never the word.\n */\n private planAuditPayloadFieldsUnit(): LabellingUnit[] {\n const { keys, keyMeta } = planAuditPayloadFieldLabelKeys();\n if (keys.length === 0) return [];\n return [{\n category: LabellingUnitCategory.AUDIT_PAYLOAD_FIELDS_ROOT,\n id: `${AUDIT_PAYLOAD_FIELDS_LABEL_BUCKET}:root`,\n displayLabel: 'audit event detail names',\n filePathHint: { bucket: AUDIT_PAYLOAD_FIELDS_LABEL_BUCKET, slug: 'root' },\n chunks: chunkKeys(AUDIT_PAYLOAD_FIELDS_LABEL_BUCKET, keys, undefined, keyMeta),\n loadSpecContext: async () => ({ audience: LabelAudience.ADMIN }),\n }];\n }\n\n /**\n * An application's own tools — `flows_actors_tools.<model tool name>.{title,working}` for every function tool its\n * backend modules register (#2551). One unit for the family, like the vendor names: two short phrases per tool. The\n * population and each key's intent are derived in `function-tool-label-keys.utils.ts`; the tool's description is passed\n * as intent, never as the words.\n */\n private async planFlowsActorsToolsUnit(tools: readonly DeclaredFunctionTool[]): Promise<LabellingUnit[]> {\n const wordFiles = this.toolResourceWordFiles(tools);\n const chunksFrom = async (readLabels: (filePath: string) => Promise<Record<string, string>>): Promise<LabellingUnitChunk[]> => {\n const words = wordFiles === undefined\n ? {}\n : await applicationResourceWords({\n resourceTypes: wordFiles.resourceTypes,\n resourceLabelFilePath: wordFiles.filePathOf,\n readLabels,\n onUnreadable: (resourceType, error) => this.logger.warn(\n `The label file of resource \"${resourceType}\" could not be read, so its tools are worded from the resource type: ${describeCaughtError(error)}`,\n ),\n });\n const { keys, keyMeta } = planFunctionToolLabelKeys(tools, words);\n return keys.length === 0 ? [] : chunkKeys(FLOWS_ACTORS_TOOLS_LABEL_BUCKET, keys, undefined, keyMeta);\n };\n const chunks = await chunksFrom(readPerUnitLabels);\n if (chunks.length === 0) return [];\n return [{\n category: LabellingUnitCategory.FLOWS_ACTORS_TOOLS_ROOT,\n id: `${FLOWS_ACTORS_TOOLS_LABEL_BUCKET}:root`,\n displayLabel: 'assistant tool names',\n filePathHint: { bucket: FLOWS_ACTORS_TOOLS_LABEL_BUCKET, slug: 'root' },\n chunks,\n loadSpecContext: async () => ({ audience: LabelAudience.END_USER }),\n // The resource words above are the previous run's; a labels run generates this unit after the resources it names\n // and re-plans it from their words as this run left them (#3253).\n ...(wordFiles === undefined ? {} : {\n wordedFromUnits: {\n afterUnitIds: wordFiles.resourceTypes.map(resourceLabellingUnitId),\n replanChunks: chunksFrom,\n },\n }),\n }];\n }\n\n /**\n * Where the application's own word for each resource a tool acts on lives (#3253): its primary-locale resource label\n * file. `undefined` when no tool names a resource, or the i18n root or the primary locale cannot be resolved: the\n * tools are then named by resource type.\n */\n private toolResourceWordFiles(tools: readonly DeclaredFunctionTool[]): { resourceTypes: string[]; filePathOf: (resourceType: string) => string } | undefined {\n const resourceTypes = [...new Set(tools.flatMap((tool) => (tool.resourceType === undefined ? [] : [tool.resourceType])))];\n if (resourceTypes.length === 0 || this.companionContext === undefined) return undefined;\n const i18nRoot = resolveApplicationI18nRoot(this.companionContext);\n if (i18nRoot === undefined || !this.appConfigService?.isInitialized?.()) return undefined;\n let primaryLocale: string;\n try {\n primaryLocale = getCompanionConfiguredPrimaryLanguage(this.appConfigService.config);\n } catch {\n return undefined;\n }\n return {\n resourceTypes,\n filePathOf: (resourceType) => path.join(i18nRoot, 'resources', `${resourceLabellingUnitSlug(resourceType)}.${primaryLocale}.ts`),\n };\n }\n\n /**\n * `errors_messages` theme unit — split out of the generic theme loop so it\n * can project per-ref `purpose` + `audience` from the authored\n * error-message specs (the errors-side twin of `planRolesUnit`). User-facing\n * error copy is then generated from intent instead of guessed from the bare\n * key string; internal refs (no spec) fall back to token-only generation.\n * Keeps the same unit id / output file (`themes/errors_messages.<locale>.ts`)\n * as before, so the lock + served bundle location are unchanged.\n */\n private planErrorsMessagesUnit(): LabellingUnit[] {\n const keys = this.collectErrorsMessagesKeys();\n if (keys.length === 0) return [];\n const keyMeta = this.specContextLoader.projectErrorMessageKeyMeta(keys);\n return [{\n category: LabellingUnitCategory.THEME,\n id: 'theme:errors_messages',\n displayLabel: 'errors_messages',\n filePathHint: { bucket: 'themes', slug: 'errors_messages' },\n chunks: chunkKeys('errors_messages', keys, undefined, keyMeta),\n // Most authored error messages are consumer-facing, so default the unit\n // to the END_USER register; per-ref ADMIN / DEVELOPER references override\n // it through their own `keyMeta.audience`.\n loadSpecContext: async () => ({ audience: LabelAudience.END_USER }),\n }];\n }\n\n /**\n * Words for every DECLARED refusal code (#1048) — `errors_refusals.<CODE>.msg`, total over the\n * `errorScenarios[].errorCode` values the resource specifications declare (see\n * `collectDeclaredRefusals` for the one exclusion). Each key's generation context is the `when`\n * text the specification authored, which for a custom refusal usually names the remedy — the sentence\n * a form used to drop on the floor.\n */\n private async planErrorsRefusalsUnit(): Promise<LabellingUnit[]> {\n const refusals = await this.specContextLoader.loadDeclaredRefusals();\n if (refusals.length === 0) return [];\n const keys: string[] = [];\n const keyMeta: Record<string, LabelKeyMeta> = {};\n for (const refusal of refusals) {\n const key = refusalLabelKey(refusal.code);\n keys.push(key);\n keyMeta[key] = {\n kind: LabelKind.MESSAGE,\n audience: LabelAudience.END_USER,\n ...(refusal.when.length > 0\n ? { purpose: `Tell the person why their request was refused and what to do instead. The refusal, as the application documents it: ${refusal.when.join(' / ')}` }\n : {}),\n };\n }\n return [{\n category: LabellingUnitCategory.THEME,\n id: `theme:${LabellingTypes.ERRORS_REFUSALS}`,\n displayLabel: LabellingTypes.ERRORS_REFUSALS,\n filePathHint: { bucket: 'themes', slug: LabellingTypes.ERRORS_REFUSALS },\n chunks: chunkKeys(LabellingTypes.ERRORS_REFUSALS, keys, undefined, keyMeta),\n loadSpecContext: async () => ({ audience: LabelAudience.END_USER }),\n }];\n }\n\n private async planRolesUnit(incompleteness?: LabellingPlanIncompleteness): Promise<LabellingUnit[]> {\n const keys = collectRoleKeys();\n if (keys.length === 0) return [];\n // Project per-role `label` / `description` keyMeta from the authored role\n // specs. Engine baseline + app-defined roles share one flat namespace, so\n // custom app roles (e.g. `CUSTOM_APP_MANAGER`) get accurate, spec-driven\n // labels instead of token-only generation. See `projectRoleKeyMeta`.\n const keyMeta = await this.specContextLoader.projectRoleKeyMeta(keys);\n return [{\n category: LabellingUnitCategory.ROLES,\n id: 'roles:root',\n displayLabel: 'roles',\n filePathHint: ROLE_LABELLING_UNIT_FILE_PATH_HINT,\n chunks: chunkKeys('roles', keys, undefined, keyMeta),\n ...(incompleteness ? { plannedFromIncompleteInputs: [incompleteness.reason] } : {}),\n // Roles are an access-control / permission vocabulary surfaced in\n // member-management, role pickers, and permission chips — an operator\n // concern. Calibrate the generator to the ADMIN register (clean console\n // terms + authority-focused descriptions) rather than the END_USER default.\n loadSpecContext: async () => ({ audience: LabelAudience.ADMIN }),\n }];\n }\n\n private planLifecycleUnit(): LabellingUnit[] {\n const keys = collectLifecycleKeys();\n if (keys.length === 0) return [];\n return [{\n category: LabellingUnitCategory.LIFECYCLE,\n id: 'lifecycle:root',\n displayLabel: 'lifecycle',\n filePathHint: { bucket: 'lifecycle', slug: 'root' },\n chunks: chunkKeys('lifecycle', keys),\n loadSpecContext: async () => undefined,\n }];\n }\n\n /**\n * App-level guidance-namespace unit (`guidance.<ref>.*`) covering BOTH:\n * - app-level guidance flows (`module.guidanceFlows`): sourced from the\n * registered `setGuidanceFlowProvider` when present (the OVERRIDE owner),\n * else from frontend-module discovery (`appLevelGuidanceFlowLabelKeys`);\n * - onboarding views (`module.onboardingViews`): ALWAYS from frontend-module\n * discovery (`onboardingViewLabelKeys`) — they share the `guidance.*`\n * namespace but have no provider contract, so the provider override must\n * never suppress them.\n *\n * Resource-scoped guidance lives inside the corresponding resource unit\n * (`planResourceUnits`), NOT here. See `resolveAppLevelGuidanceLabelKeys` for\n * the override + de-duplication rule.\n */\n private async planAppGuidanceUnit(\n derived: FrontendDerivedLabelKeys,\n frontendIncompleteness?: LabellingPlanIncompleteness,\n ): Promise<LabellingUnit[]> {\n const keys = resolveAppLevelGuidanceLabelKeys({\n guidanceFlowProviderRegistered: this.guidanceFlowProviderRegistered,\n providerGuidanceFlowKeys: collectAppGuidanceKeys(this.guidanceFlowProvider()),\n discoveredGuidanceFlowKeys: derived.appLevelGuidanceFlowLabelKeys,\n onboardingViewKeys: derived.onboardingViewLabelKeys,\n });\n if (keys.length === 0) return [];\n // App-level onboarding views + guidance flows author per-slot + per-element\n // purposes in their specs (keyed `app.<ref>`). Project them onto the bare-ref\n // `guidance.<ref>.*` keys so the modal/flow copy reflects authored intent\n // instead of generic filler (\"Utilize AI to enhance your workflow\").\n const keyMeta = await this.specContextLoader.projectGuidanceKeyMeta(keys);\n return [{\n category: LabellingUnitCategory.GUIDANCE_ROOT,\n id: 'guidance:root',\n displayLabel: 'guidance',\n filePathHint: { bucket: 'guidance', slug: 'root' },\n chunks: chunkKeys('guidance', keys, undefined, keyMeta),\n loadSpecContext: async () => undefined,\n // The discovered flow and onboarding-view keys come from the frontend snapshot; the\n // provider-registered ones do not, so a degraded run still plans a unit — a partial one.\n ...(frontendIncompleteness ? { plannedFromIncompleteInputs: [frontendIncompleteness.reason] } : {}),\n }];\n }\n\n private planAdditionalUnit(): LabellingUnit[] {\n const keys = [...additionalLabelsRefs];\n if (keys.length === 0) return [];\n return [{\n category: LabellingUnitCategory.ADDITIONAL,\n id: 'additional:root',\n displayLabel: 'additional',\n filePathHint: { bucket: 'themes', slug: 'additional' },\n chunks: chunkKeys('additional', keys),\n loadSpecContext: async () => undefined,\n }];\n }\n\n // ================================================================\n // Theme key collectors\n // ================================================================\n\n private collectErrorsMessagesKeys(): string[] {\n const sectionConfig = LabellingPolicy[LabellingTypes.ERRORS_MESSAGES] as Record<string, LabellingUnitaryDef[]>;\n const displayDefs = readDefs(sectionConfig as unknown as Record<string, LabellingUnitaryDef[]>, 'display');\n const keys: string[] = [];\n for (const ref of Object.values(ErrorCustomMessageReference) as string[]) {\n for (const sub of displayDefs) {\n keys.push(`${LabellingTypes.ERRORS_MESSAGES}.${ref}.${sub}`);\n }\n }\n return keys;\n }\n\n private collectErrorsGuidanceKeys(): { keys: string[]; keyParams: Record<string, string[]>; keyMeta: Record<string, LabelKeyMeta> } {\n // Per-field declared params live in `LabellingPolicy[ERRORS_GUIDANCE].display`\n // (e.g. `retryCountdown → [\"seconds\"]`); `ERROR_GUIDANCE_REFS` only lists\n // which fields each ref needs. Build a field→params map, then attach it to\n // every `errors_guidance.<ref>.<field>` key whose field declares params.\n const displayDefs =\n (LabellingPolicy[LabellingTypes.ERRORS_GUIDANCE] as Record<string, LabellingUnitaryDef[]> | undefined)?.['display'] ?? [];\n const fieldParams: Record<string, string[]> = {};\n const fieldCountParams: Record<string, string[]> = {};\n for (const def of displayDefs) {\n if (typeof def === 'string' || !def?.ref || !def.params || def.params.length === 0) continue;\n const params = def.params\n .map((p) => (typeof p === 'string' ? p : p?.key))\n .filter((p): p is string => typeof p === 'string' && p.length > 0);\n if (params.length > 0) fieldParams[def.ref] = params;\n const countParams = readDeclaredCountParams(def.params);\n if (countParams.length > 0) fieldCountParams[def.ref] = countParams;\n }\n\n const keys: string[] = [];\n const keyParams: Record<string, string[]> = {};\n const keyMeta: Record<string, LabelKeyMeta> = {};\n for (const [ref, fields] of Object.entries(ERROR_GUIDANCE_REFS)) {\n for (const field of fields) {\n const key = `${LabellingTypes.ERRORS_GUIDANCE}.${ref}.${field}`;\n keys.push(key);\n const params = fieldParams[field];\n if (params) keyParams[key] = params;\n const countParams = fieldCountParams[field];\n if (countParams) keyMeta[key] = { countParams };\n }\n }\n return { keys, keyParams, keyMeta };\n }\n\n private collectErrorsValidationKeys(): string[] {\n const sectionConfig = LabellingPolicy[LabellingTypes.ERRORS_VALIDATION] as Record<string, LabellingUnitaryDef[]> | undefined;\n if (!sectionConfig) return [];\n const keys: string[] = [];\n for (const issueCode of Object.keys(sectionConfig)) {\n for (const def of sectionConfig[issueCode] || []) {\n const sub = typeof def === 'string' ? def : def?.ref;\n if (sub) keys.push(`${LabellingTypes.ERRORS_VALIDATION}.${issueCode}.${sub}`);\n }\n }\n return keys;\n }\n\n /**\n * The `notifications_custom` theme: the in-app notices (`collectNotificationsCustomKeys`, with the engine notices'\n * declared purposes and parameters) and the SMS notification texts (#1875, `collectSmsNotificationLabelKeys`, each with\n * its declared purpose, parameters and the one-segment length rule). One theme, because both are keyed by the\n * notification identifier and an identifier may carry both.\n */\n private collectNotificationsCustomTheme(): { keys: string[]; keyParams: Record<string, string[]>; keyMeta: Record<string, LabelKeyMeta> } {\n const inApp = notificationsCustomKeyParams(this.collectNotificationsCustomKeys());\n const registry = this.resourcesRegistryService.getResourcesRegistry();\n const sms = collectSmsNotificationLabelKeys(Object.values(\n this.applicationLabelVocabulary(registry.resourceConfigurations as Record<string, AnyResourceConfiguration> | undefined),\n ) as Parameters<typeof collectSmsNotificationLabelKeys>[0]);\n return {\n keys: [...inApp.keys, ...sms.keys],\n keyParams: { ...inApp.keyParams, ...sms.keyParams },\n keyMeta: { ...inApp.keyMeta, ...sms.keyMeta },\n };\n }\n\n private collectNotificationsCustomKeys(): string[] {\n const keys: string[] = [];\n const seen = new Set<string>();\n const registry = this.resourcesRegistryService.getResourcesRegistry();\n // The application's own notices only (#3231): a workbench operation's notice is the companion's word, not the application's.\n const allResources = this.applicationLabelVocabulary(registry.resourceConfigurations as Record<string, AnyResourceConfiguration> | undefined);\n\n for (const resourceConfig of Object.values(allResources)) {\n for (const op of resourceConfig.operations || []) {\n const notifs = (op as { userNotifications?: Array<{ channel: string; identifier: string; nextStep?: unknown }> }).userNotifications;\n if (!notifs) continue;\n for (const n of notifs) {\n if (n.channel !== 'front_end_success') continue;\n if (!n.identifier || seen.has(n.identifier)) continue;\n seen.add(n.identifier);\n keys.push(`${LabellingTypes.NOTIFICATIONS_CUSTOM}.${n.identifier}.msg`);\n if (n.nextStep) keys.push(`${LabellingTypes.NOTIFICATIONS_CUSTOM}.${n.identifier}.nextStepLabel`);\n }\n }\n }\n\n const sectionConfig = LabellingPolicy[LabellingTypes.NOTIFICATIONS_CUSTOM] as Record<string, LabellingUnitaryDef[]> | undefined;\n const displayDefs = readDefs(sectionConfig as unknown as Record<string, LabellingUnitaryDef[]>, 'display');\n for (const ref of Object.values(FrontendNotificationCustomMessageRefs) as string[]) {\n if (seen.has(ref)) continue;\n seen.add(ref);\n for (const sub of displayDefs) {\n keys.push(`${LabellingTypes.NOTIFICATIONS_CUSTOM}.${ref}.${sub}`);\n }\n }\n return keys;\n }\n\n /**\n * The `system_enums.<EnumName>.<value>` keys, DERIVED — see `buildSystemEnumLabelKeys` for\n * its four sources and the ordering contract.\n *\n * This method used to be nine literal `push(...)` calls: a hand-kept copy of another\n * module's catalogue, and the exact shape that rots. It had rotted twice by the time it was\n * measured (2026-09-08):\n *\n * - `SystemEnumName.DURATION_UNIT` was declared in `presets-components-models` and absent\n * from the list, so a `z_duration()` unit was planned nowhere;\n * - ten vocabularies decorated with `.systemEnum('X')` on real resource schemas — the\n * seven billing ones plus `PlatformAccessGrantStatus`,\n * `PlatformAccessGrantAutoApprovalReason` and `DurationUnit` — were SUPPRESSED from\n * per-field labelling by `extractResourceFieldKeys` on the promise that they would be\n * labelled here, and were not. `tResourceFieldEnumValue` then falls through to step 3 of\n * its cascade and renders the raw wire value, so a subscription badge read `past_due`\n * and a product type read `one_time` in the generated dogfood application.\n *\n * The derivation lives beside `extractResourceFieldKeys` rather than here precisely because\n * those are the two halves that have to agree; keeping them in one module is what lets one\n * test assert the invariant between them.\n */\n private collectSystemEnumsKeys(pauseStates: readonly string[]): string[] {\n const registry = this.resourcesRegistryService.getResourcesRegistry();\n // The application's vocabularies only (#3231): an enum only a workbench resource declares is the companion's word.\n const allResources = this.applicationLabelVocabulary(registry.resourceConfigurations as Record<string, AnyResourceConfiguration> | undefined);\n const applicationVocabularies = collectApplicationConfigSystemEnumVocabularies(this.readApplicationConfig());\n // The gates' pause states (#1864): declared in the backend modules rather than the configuration, same vocabulary family.\n if (pauseStates.length > 0) applicationVocabularies.set(ApplicationConfigVocabulary.HUMAN_DECISION_PAUSE_STATE, [...new Set(pauseStates)]);\n return buildSystemEnumLabelKeys(Object.values(allResources), applicationVocabularies);\n }\n\n /**\n * Every pause state an approval gate declares (#1864), from the backend subprocess (the only place a function tool\n * exists). An application with no backend service has no gates: an authoritative empty answer. A backend that could\n * not answer, or answered without the projection, is a degradation: the plan would otherwise hold no pause-state\n * words and a write would prune them.\n */\n private async collectHumanDecisionGateDeclarations(): Promise<{ pauseStates: readonly string[]; incompleteness?: LabellingPlanIncompleteness }> {\n const degraded = (detail: string) => {\n this.logger.warn(`Pause-state label planning skipped: ${detail}`);\n return {\n pauseStates: [],\n incompleteness: { reason: LabellingPlanIncompletenessReason.HUMAN_DECISION_GATES_INTROSPECTION_FAILED, detail, suppressedBuckets: [] },\n };\n };\n const backendServiceKey = Object.entries(this.companionContext.servicesByKey)\n .find(([, service]) => !service.frontendType)?.[0];\n if (!backendServiceKey) return { pauseStates: [] };\n\n const result = await this.introspectionService.requestInfo({ serviceKey: backendServiceKey, behavior: 'human-decision-gate-declarations' });\n if (!result.success) {\n const message = 'error' in result ? result.error.message : 'unknown error';\n return degraded(`human-decision-gate-declarations introspection failed on '${backendServiceKey}': ${message}`);\n }\n const gates = (result.data as { gates?: unknown } | undefined)?.gates;\n if (!Array.isArray(gates)) {\n return degraded(`human-decision-gate-declarations on '${backendServiceKey}' returned no gates array (a subprocess predating the projection, or a malformed payload).`);\n }\n const pauseStates: string[] = [];\n const unkeyable: string[] = [];\n for (const gate of gates) {\n const states = (gate as { pauseStates?: unknown } | null)?.pauseStates;\n if (!Array.isArray(states)) continue;\n for (const state of states) {\n if (typeof state !== 'string' || state.length === 0) continue;\n // A state that cannot be a key segment is refused at backend startup; the companion may still be reading\n // the declaration, and planning it would nest a key inside the label tree.\n if (isLabelKeySegment(state)) pauseStates.push(state);\n else unkeyable.push(state);\n }\n }\n if (unkeyable.length > 0) {\n return degraded(`pause state(s) ${unkeyable.map((state) => `\"${state}\"`).join(', ')} contain characters a label key segment cannot hold (letters, digits, \"_\" and \"-\" only); the backend refuses them at startup.`);\n }\n this.logDebug(`Pause states read from introspection: ${pauseStates.length}`);\n return { pauseStates };\n }\n\n /**\n * Every function tool the application's backend modules register (#2551), from the backend subprocess (the only place a\n * function tool exists). An application with no backend service has no tools: an authoritative empty answer. A backend\n * that could not answer, or answered without the projection, degrades and suppresses the bucket, so a write cannot prune\n * the tool words it could not see.\n */\n private async collectFunctionToolDeclarations(): Promise<{ tools: readonly DeclaredFunctionTool[]; incompleteness?: LabellingPlanIncompleteness }> {\n const degraded = (detail: string) => {\n this.logger.warn(`Tool label planning skipped: ${detail}`);\n return {\n tools: [],\n incompleteness: { reason: LabellingPlanIncompletenessReason.FUNCTION_TOOLS_INTROSPECTION_FAILED, detail, suppressedBuckets: [FLOWS_ACTORS_TOOLS_LABEL_BUCKET] },\n };\n };\n const backendServiceKey = Object.entries(this.companionContext.servicesByKey)\n .find(([, service]) => !service.frontendType)?.[0];\n if (!backendServiceKey) return { tools: [] };\n\n const result = await this.introspectionService.requestInfo({ serviceKey: backendServiceKey, behavior: 'function-tool-declarations' });\n if (!result.success) {\n const message = 'error' in result ? result.error.message : 'unknown error';\n return degraded(`function-tool-declarations introspection failed on '${backendServiceKey}': ${message}`);\n }\n const tools = readDeclaredFunctionTools(result.data);\n if (!tools) {\n return degraded(`function-tool-declarations on '${backendServiceKey}' returned no tools array (a subprocess predating the projection, or a malformed payload).`);\n }\n this.logDebug(`Function tools read from introspection: ${tools.length}`);\n return { tools };\n }\n\n /**\n * The registry's resources the application owes labels for (#3231): without the companion's own vocabularies, and\n * without the engine resources the application's backend leaves unregistered. The companion assembles its registry\n * with no feature gate, so the gate is applied here, decided by the backend's own `resolveFeatureGatedCoreResourceExclusions`\n * over the application's configuration. An unreadable configuration excludes nothing: the plan then carries words for\n * a few engine resources the application may not register, which costs model calls and never a missing word.\n */\n private applicationLabelVocabulary(resourceConfigurations: Record<string, AnyResourceConfiguration> | undefined): Record<string, AnyResourceConfiguration> {\n return applicationLabelVocabularyResources(resourceConfigurations, this.readFeatureGatedResourceExclusions());\n }\n\n private readFeatureGatedResourceExclusions(): ReadonlySet<string> | undefined {\n try {\n if (!this.appConfigService?.isInitialized?.()) return undefined;\n return resolveFeatureGatedCoreResourceExclusions(this.appConfigService.config);\n } catch {\n return undefined;\n }\n }\n\n /**\n * The application's configuration, or `undefined` before it is initialized. A plan asked for before then plans the\n * framework's vocabularies and the schema-declared ones, and the configuration-declared ones on the next run.\n */\n private readApplicationConfig(): ApplicationConfigVocabularySources | undefined {\n try {\n return this.appConfigService?.isInitialized?.() ? this.appConfigService.config : undefined;\n } catch {\n return undefined;\n }\n }\n\n private collectBackendAuthMessagesKeys(): string[] {\n const sectionConfig = LabellingPolicy[LabellingTypes.BACKEND_AUTH_MESSAGES] as Record<string, LabellingUnitaryDef[]>;\n const displayDefs = readDefs(sectionConfig as unknown as Record<string, LabellingUnitaryDef[]>, 'display');\n const keys: string[] = [];\n for (const ref of Object.values(AuthResponseMessageRef) as string[]) {\n for (const sub of displayDefs) {\n keys.push(`${LabellingTypes.BACKEND_AUTH_MESSAGES}.${ref}.${sub}`);\n }\n }\n return keys;\n }\n\n /**\n * The words of the documents the backend writes itself (#2907): today the approval page of an approved deliverable's\n * manifested copy. Total over the engine's declaration, so a word declared tomorrow is planned with no edit here, each\n * with what it must say and what its parameters mean.\n */\n private collectBackendDocumentsTheme(): { keys: string[]; keyParams: Record<string, string[]>; keyMeta: Record<string, LabelKeyMeta> } {\n const keys: string[] = [];\n const keyParams: Record<string, string[]> = {};\n const keyMeta: Record<string, LabelKeyMeta> = {};\n // Each backend document's words, declared by the engine: the approval page of a manifested copy, and the public\n // verification page its QR code links to (#2907). A word declared tomorrow is planned with no edit here.\n const declared: Array<readonly [string, ApprovalSealManifestationWordDeclaration]> = [\n ...Object.entries(APPROVAL_SEAL_MANIFESTATION_WORDS).map(([word, declaration]) => [approvalSealManifestationWordKey(word as ApprovalSealManifestationWord), declaration] as const),\n ...Object.entries(APPROVAL_SEAL_VERIFICATION_PAGE_WORDS).map(([word, declaration]) => [approvalSealVerificationPageWordKey(word as ApprovalSealVerificationPageWord), declaration] as const),\n ];\n for (const [key, declaration] of declared) {\n keys.push(key);\n if (declaration.params.length > 0) keyParams[key] = [...declaration.params];\n keyMeta[key] = { purpose: declaration.purpose, ...(declaration.paramMeanings ? { paramMeanings: declaration.paramMeanings } : {}) };\n }\n return { keys, keyParams, keyMeta };\n }\n\n private collectBackendSmsKeys(): string[] {\n const sectionConfig = LabellingPolicy[LabellingTypes.BACKEND_SMS] as Record<string, LabellingUnitaryDef[]> | undefined;\n if (!sectionConfig) return [];\n const keys: string[] = [];\n for (const smsRef of Object.keys(sectionConfig)) {\n for (const def of sectionConfig[smsRef] || []) {\n const sub = typeof def === 'string' ? def : def?.ref;\n if (sub) keys.push(`${LabellingTypes.BACKEND_SMS}.${smsRef}.${sub}`);\n }\n }\n return keys;\n }\n\n // ================================================================\n // Helpers\n // ================================================================\n\n}\n\nfunction readDefs(section: Record<string, LabellingUnitaryDef[]> | undefined, key: string): string[] {\n const defs = section?.[key];\n if (!Array.isArray(defs)) return [];\n return defs\n .map((d) => (typeof d === 'string' ? d : d?.ref))\n .filter((s): s is string => typeof s === 'string' && s.length > 0);\n}\n\n/**\n * A field's description and tooltip keys, as the frontend snapshot computed them: `resources.{type}.fields.{path}.\n * {display|edit}.{description|tooltip}`. Capture groups: resource type, field path, mode, text slot.\n */\nconst FRONTEND_FIELD_TEXT_KEY = /^resources\\.([^.]+)\\.fields\\.(.+)\\.(display|edit)\\.(description|tooltip)$/;\n\n/**\n * The field description and tooltip keys the frontend snapshot planned, grouped by resource type.\n *\n * WHY THIS BRIDGE EXISTS. Whether a field shows a description or a tooltip is authored in the\n * resource's ui-behavior (`edit: { showDescription: true }`, a tooltip on the display or edit config),\n * and that config is written onto the FRONTEND registry's schemas, which only the introspection\n * subprocess can build. `extractResourceFieldKeys` asks the same question (`hasDescriptionForEdit`,\n * `hasTooltipForDisplay`, …) of the BACKEND registry's schemas, which do not carry what a ui-behavior writes,\n * so it missed every description and tooltip authored there. The subprocess computes them correctly, and `planFrontendDerivedUnits`\n * drops every `resources.*` key it sends as planner-owned. Same gap as the section and operation\n * description bridges in `planResourceUnits`. Its cost was not only missing words: adoption drops every key the plan no\n * longer holds, so the first run after a unit's inputs changed deleted descriptions a form renders\n * (measured on Wonder Todos 2026-10-29: 205 descriptions and 16 tooltips, e.g. the todo description\n * field's \"Add context with lists, links, or headings.\").\n */\nfunction groupFrontendFieldTextKeysByResource(appSpecificLabelKeys: readonly string[]): Map<string, string[]> {\n const byResource = new Map<string, string[]>();\n for (const key of appSpecificLabelKeys) {\n const match = FRONTEND_FIELD_TEXT_KEY.exec(key);\n if (!match) continue;\n const resourceType = match[1]!;\n const list = byResource.get(resourceType);\n if (list) list.push(key);\n else byResource.set(resourceType, [key]);\n }\n return byResource;\n}\n\n/**\n * Add each frontend-planned description or tooltip key whose field the backend walk planned for the same\n * mode. Keying on the planned `.label` of that field and mode keeps the backend walk the authority on\n * WHICH fields and modes are owed words: a field it does not know, or hides in that mode\n * (`isHiddenForDisplay` / `isHiddenForEdit`), gets no description either. Mutates `fieldKeys` in place.\n */\nfunction addFrontendFieldTextKeys(fieldKeys: string[], frontendKeys: readonly string[] | undefined): void {\n if (!frontendKeys || frontendKeys.length === 0) return;\n const planned = new Set(fieldKeys);\n for (const key of frontendKeys) {\n if (planned.has(key)) continue;\n const labelKey = key.replace(/\\.(description|tooltip)$/, '.label');\n if (!planned.has(labelKey)) continue;\n // Beside its label, so a resource whose field keys span several chunks keeps a field's words together.\n fieldKeys.splice(fieldKeys.indexOf(labelKey) + 1, 0, key);\n planned.add(key);\n }\n}\n\n/**\n * Split a unit's keys into chunks of at most `MAX_ITEMS_PER_CHUNK`, each carrying the output schema the\n * model answers against. Exported for the translate pipeline's email lane (#1908), whose keys come from\n * an authored source file rather than from this planner, so both lanes send the model identically-shaped\n * requests.\n */\nexport function chunkKeys(\n unitId: string,\n keys: string[],\n keyParams?: Record<string, string[]>,\n keyMeta?: Record<string, LabelKeyMeta>,\n): LabellingUnitChunk[] {\n if (keys.length <= MAX_ITEMS_PER_CHUNK) {\n return [makeChunk('all', keys, keyParams, keyMeta)];\n }\n const chunks: LabellingUnitChunk[] = [];\n for (let i = 0; i < keys.length; i += MAX_ITEMS_PER_CHUNK) {\n chunks.push(makeChunk(`chunk-${Math.floor(i / MAX_ITEMS_PER_CHUNK) + 1}`, keys.slice(i, i + MAX_ITEMS_PER_CHUNK), keyParams, keyMeta));\n }\n return chunks;\n}\n\nfunction subgroupsToChunks(\n unitId: string,\n subgroups: { id: string; keys: string[] }[],\n keyMeta?: Record<string, LabelKeyMeta>,\n): LabellingUnitChunk[] {\n const chunks: LabellingUnitChunk[] = [];\n for (const { id, keys } of subgroups) {\n if (keys.length === 0) continue;\n if (keys.length <= MAX_ITEMS_PER_CHUNK) {\n chunks.push(makeChunk(id, keys, undefined, keyMeta));\n } else {\n for (let i = 0; i < keys.length; i += MAX_ITEMS_PER_CHUNK) {\n chunks.push(makeChunk(`${id}-${Math.floor(i / MAX_ITEMS_PER_CHUNK) + 1}`, keys.slice(i, i + MAX_ITEMS_PER_CHUNK), undefined, keyMeta));\n }\n }\n }\n return chunks;\n}\n\nfunction makeChunk(\n chunkId: string,\n keys: string[],\n keyParams?: Record<string, string[]>,\n keyMeta?: Record<string, LabelKeyMeta>,\n): LabellingUnitChunk {\n // Narrow the threaded param + meta maps to THIS chunk's keys — a unit's keys\n // are split across chunks at MAX_ITEMS_PER_CHUNK, so each chunk should only\n // carry what it actually owns (keeps the prompt focused per call).\n let chunkKeyParams: Record<string, string[]> | undefined;\n if (keyParams) {\n for (const k of keys) {\n const params = keyParams[k];\n if (params && params.length > 0) {\n (chunkKeyParams ??= {})[k] = params;\n }\n }\n }\n let chunkKeyMeta: Record<string, LabelKeyMeta> | undefined;\n if (keyMeta) {\n for (const k of keys) {\n const meta = keyMeta[k];\n if (meta) (chunkKeyMeta ??= {})[k] = meta;\n }\n }\n return {\n chunkId,\n keys,\n keyParams: chunkKeyParams,\n keyMeta: chunkKeyMeta,\n buildOutputSchema: (requestedKeys?: readonly string[]) => {\n const owned = new Set(keys);\n const subject = requestedKeys ?? keys;\n const shape: Record<string, z.ZodOptional<z.ZodString>> = {};\n for (const k of subject) {\n // Fail closed on a key this chunk does not own: the agent would happily\n // produce a label for it and the orchestrator would write it into the\n // unit file under a path nothing reads.\n if (!owned.has(k)) throw new Error(`Chunk ${chunkId} was asked to generate a key it does not own: ${k}`);\n // Optional by contract — see `LabellingUnitChunk.buildOutputSchema`.\n shape[k] = z.string().optional();\n }\n return z.object(shape);\n },\n };\n}\n\n/**\n * The params a label declares `isCount` (#2263) — the numbers its words agree with, for which the\n * generator writes plural forms. One reader for every planner site that reads `LabelParamDef`, so a\n * component label and an error-guidance label mean the same thing by the same flag.\n */\nexport function readDeclaredCountParams(params: readonly LabelParamDef[] | undefined): string[] {\n return (params ?? [])\n .filter((param): param is Exclude<LabelParamDef, string> => typeof param !== 'string' && param?.isCount === true)\n .map((param) => param.key)\n .filter((key) => typeof key === 'string' && key.length > 0);\n}\n\n/**\n * Merge each view label's declared count params into the unit's per-key metadata, keeping whatever the\n * specification projection already set for that key. `undefined` stays `undefined` when nothing applies.\n */\nexport function withDeclaredLabelCountParams(\n keys: readonly string[],\n keyMeta: Record<string, LabelKeyMeta> | undefined,\n /** Absent from a snapshot built before the field existed — read as \"no view declares a count\". */\n countParamsByKey: Readonly<Record<string, readonly string[]>> | undefined,\n): Record<string, LabelKeyMeta> | undefined {\n let merged = keyMeta;\n for (const key of keys) {\n const countParams = countParamsByKey?.[key];\n if (!countParams || countParams.length === 0) continue;\n merged = { ...(merged ?? {}), [key]: { ...(merged?.[key] ?? {}), countParams } };\n }\n return merged;\n}\n\nfunction slugify(input: string): string {\n return input.replace(/[^A-Za-z0-9_-]+/g, '_');\n}\n\nfunction countByCategory(units: LabellingUnit[]): Record<string, number> {\n const out: Record<string, number> = {};\n for (const u of units) out[u.category] = (out[u.category] ?? 0) + 1;\n return out;\n}\n\n"]}
1
+ {"version":3,"file":"labelling-planner.companion.service.js","sourceRoot":"","sources":["../../../../src/i18n-labelling/services/labelling-planner.companion.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,cAAc,EACd,eAAe,EACf,oBAAoB,EAGpB,4BAA4B,EAC5B,aAAa,EACb,SAAS,EACT,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,qBAAqB,EACrB,2BAA2B,EAC3B,qCAAqC,EACrC,2CAA2C,EAC3C,6CAA6C,EAC7C,mBAAmB,GAGpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,E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AC;IACpE,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import * as path from 'node:path';\nimport { inject, injectable, optional } from 'inversify';\nimport { z } from 'zod';\nimport {\n LabellingTypes,\n LabellingPolicy,\n additionalLabelsRefs,\n type LabellingUnitaryDef,\n type LabelParamDef,\n getRegisteredComponentLabels,\n LabelAudience,\n LabelKind,\n AuthResponseMessageRef,\n ResourceOperationTextSlot,\n} from '@wildo-ai/presets-components-models';\nimport {\n CoreResourceOperation,\n ErrorCustomMessageReference,\n FrontendNotificationCustomMessageRefs,\n FRONTEND_NOTIFICATION_CUSTOM_MESSAGE_PARAMS,\n FRONTEND_NOTIFICATION_CUSTOM_MESSAGE_PURPOSES,\n ERROR_GUIDANCE_REFS,\n type AnyResourceConfiguration,\n type GuidanceFlowDefinition,\n} from '@wildo-ai/saas-models';\nimport {\n SAAS_SERVICE_TYPES,\n ResourcesRegistryBackendService,\n resolveFeatureGatedCoreResourceExclusions,\n describeCaughtError,\n} from '@wildo-ai/saas-backend-lib';\nimport type {\n AppConfigurationService,\n LoggerService,\n} from '@wildo-ai/saas-backend-lib';\nimport { COMPANION_SERVICE_TYPES } from '../../core/inject/models/service-types';\nimport {\n LabellingPlanIncompletenessReason,\n type LabellingMilestoneDefinition,\n type LabellingProductDefinition,\n type LabellingFeatureDefinition,\n LabellingUnitCategory,\n MAX_ITEMS_PER_CHUNK,\n type LabellingPlanIncompleteness,\n type LabellingPlanResult,\n type LabellingUnit,\n type LabellingUnitChunk,\n type LabelKeyMeta,\n} from '../models/labelling-unit.models';\nimport { LabellingSpecContextLoaderCompanionService } from './labelling-spec-context-loader.companion.service';\nimport { planResourceSectionLabelKeys } from '../utils/resource-section-label-keys.utils';\nimport { resolveFrontendPlanDegradation } from '../utils/incomplete-plan-refusal.utils';\nimport { ComponentLabelsBootstrapCompanionService } from './component-labels-bootstrap.companion.service';\nimport {\n extractResourceFieldKeys,\n buildEphemeralFieldKeyMeta,\n buildSystemEnumLabelKeys,\n collectApplicationConfigSystemEnumVocabularies,\n type ApplicationConfigVocabularySources,\n} from '../utils/schema-fields-extractor.utils';\nimport { collectAppGuidanceKeys, collectResourceGuidanceKeys, resolveAppLevelGuidanceLabelKeys } from '../utils/guidance-keys.utils';\nimport {\n type FrontendDerivedLabelKeys,\n EMPTY_FRONTEND_DERIVED_LABEL_KEYS,\n parseFrontendDerivedLabelSnapshot,\n} from '../utils/frontend-derived-label-keys.utils';\nimport {\n ROLE_LABELLING_UNIT_FILE_PATH_HINT,\n collectRoleKeys,\n collectLifecycleKeys,\n} from '../utils/role-lifecycle-keys.utils';\nimport type { CompanionContext } from '../../core/context/companion-context';\nimport { CompanionIntrospectionService } from '../../core/introspection/services/companion-introspection.companion.service';\nimport { APPROVAL_SEAL_MANIFESTATION_WORDS, APPROVAL_SEAL_VERIFICATION_PAGE_WORDS, AppFrontendType, ApplicationConfigVocabulary, CORE_FEATURE_DEFINITIONS, FLOWS_ACTORS_TOOLS_LABEL_BUCKET, FeatureValueType, approvalSealManifestationWordKey, approvalSealVerificationPageWordKey, isLabelKeySegment, type ApprovalSealManifestationWord, type ApprovalSealManifestationWordDeclaration, type ApprovalSealVerificationPageWord } from '@wildo-ai/saas-models';\nimport { ENGINE_PAGE_METADATA } from '@wildo-ai/saas-frontend-lib/companion';\nimport { refusalLabelKey, refusalLabelPurpose } from '../utils/declared-refusal-codes.utils';\nimport { collectSmsNotificationLabelKeys } from '../utils/sms-notification-label-keys.utils';\nimport {\n PROVIDERS_LABEL_BUCKET,\n planProviderDisplayNameKeys,\n readDeclaredProviderRefs,\n type DeclaredProviderRefsReading,\n} from '../utils/provider-display-name-keys.utils';\nimport {\n planProviderConnectionParameterKeys,\n planProviderVendorRegistrationStepKeys,\n planProviderCredentialFieldKeys,\n readDeclaredProviderCredentialFields,\n type DeclaredProviderCredentialField,\n type DeclaredProviderVendorRegistrationStep,\n type DeclaredProviderCredentialFieldsReading,\n} from '../utils/provider-credential-field-keys.utils';\nimport {\n SYSTEMS_OF_RECORD_LABEL_BUCKET,\n planSystemOfRecordDisplayNameKeys,\n readDeclaredSystemOfRecordInstances,\n} from '../utils/system-of-record-display-name-keys.utils';\nimport { applicationResourceWords, planFunctionToolLabelKeys, readDeclaredFunctionTools, type DeclaredFunctionTool } from '../utils/function-tool-label-keys.utils';\nimport { readPerUnitLabels, resolveApplicationI18nRoot } from '../utils/per-unit-file.utils';\nimport { getCompanionConfiguredPrimaryLanguage } from '../../core/config/primary-language.companion.utils';\nimport { AUDIT_PAYLOAD_FIELDS_LABEL_BUCKET, planAuditPayloadFieldLabelKeys } from '../utils/audit-payload-field-label-keys.utils';\nimport {\n applicationLabelVocabularyResources,\n classifyLabellingResourceProvenance,\n isCompanionOnlyResourceType,\n orderLabellingUnitsByVisibility,\n resourceLabellingUnitId,\n resourceLabellingUnitSlug,\n} from '../utils/application-label-vocabulary.utils';\n\n/** Static identity of one frontend-derived label family (see `FRONTEND_DERIVED_FAMILIES`). */\ninterface FrontendDerivedFamilyDescriptor {\n category: LabellingUnitCategory;\n id: string;\n displayLabel: string;\n bucket: string;\n prefix: string;\n}\n\n/**\n * The label families that exist ONLY if the frontend key snapshot could be\n * collected — their ref space is authored in the frontend app and cannot be\n * enumerated from any backend registry.\n *\n * Hoisted out of `planFrontendDerivedUnits` so that\n * {@link FRONTEND_DERIVED_LABEL_BUCKETS} — the list a degraded run reports as\n * unjudgeable — is DERIVED from the same descriptors the units are built from.\n * A hand-kept second copy would rot the day a fifth family is added, and it\n * would rot in the dangerous direction: a bucket missing from the suppression\n * list is a bucket an orphan report would happily condemn.\n */\nconst FRONTEND_DERIVED_FAMILIES: readonly FrontendDerivedFamilyDescriptor[] = [\n {\n category: LabellingUnitCategory.COMPOSITE_VIEW,\n id: 'composite-views:root',\n displayLabel: 'composite views',\n bucket: 'composite_views',\n prefix: `${LabellingTypes.COMPOSITE_VIEWS}.`,\n },\n {\n category: LabellingUnitCategory.VIEW,\n id: 'views:root',\n displayLabel: 'navigation views',\n bucket: 'views',\n prefix: `${LabellingTypes.VIEWS}.`,\n },\n {\n category: LabellingUnitCategory.SIDEBAR_SECTIONS_ROOT,\n id: 'sidebar-sections:root',\n displayLabel: 'sidebar sections',\n bucket: 'sidebar_sections',\n prefix: `${LabellingTypes.SIDEBAR_SECTIONS}.`,\n },\n {\n // Settings Hub rail labels — the application's authored categories and\n // placed sections.\n //\n // `keyMeta` comes from the SUBPROCESS (`derived.settingsHubKeyMeta`),\n // not from a spec registry like its three siblings: the authored wording\n // lives in the application's own `settings-hub.config.ts` and in the\n // engine destination catalog, neither of which the spec loader reads.\n // Threading it is not cosmetic — a generated key WINS over the authored\n // fallback in `tSettingsHubSection`, so a prompt working from the ref\n // alone silently REPLACES the rail's wording (measured on Wonder CRM\n // 2026-08-30: \"User provisioning\" → \"SCIM\", \"Audit streaming\" → \"SIEM\").\n category: LabellingUnitCategory.SETTINGS_HUB_ROOT,\n id: 'settings-hub:root',\n displayLabel: 'settings hub sections',\n bucket: 'settings_hub',\n prefix: `${LabellingTypes.SETTINGS_HUB}.`,\n },\n {\n // The command menu's application-defined category headings (#3122): `collectCommandCategoryLabelKeys`.\n category: LabellingUnitCategory.COMMAND_CATEGORIES_ROOT,\n id: 'command-categories:root',\n displayLabel: 'command menu categories',\n bucket: 'command_categories',\n prefix: `${LabellingTypes.COMMAND_CATEGORIES}.`,\n },\n];\n\n/**\n * The `filePathHint.bucket` values a failed frontend introspection suppresses.\n * Derived — never authored — from {@link FRONTEND_DERIVED_FAMILIES}.\n */\nexport const FRONTEND_DERIVED_LABEL_BUCKETS: readonly string[] = FRONTEND_DERIVED_FAMILIES.map(\n (family) => family.bucket,\n);\n\n/**\n * What the writer is told about the engine's notices, by key.\n *\n * - The declared PARAMETERS (`FRONTEND_NOTIFICATION_CUSTOM_MESSAGE_PARAMS`, #2813), on their `msg` keys: the names seed\n * the placeholders the drift validator checks, and the meanings tell the writer what each names.\n * - The declared PURPOSE (`FRONTEND_NOTIFICATION_CUSTOM_MESSAGE_PURPOSES`, #3148), on the `msg` and `nextStepLabel` keys:\n * what the notice says and to whom. Without it the writer had only the key name, and every reviewer's deadline notice\n * came out as \"Your request was not claimed in time\".\n *\n * Only keys the plan holds get an entry; an application's own notices (`userNotifications` on its operations) declare\n * neither and keep none.\n */\nexport function notificationsCustomKeyParams(keys: string[]): { keys: string[]; keyParams: Record<string, string[]>; keyMeta: Record<string, LabelKeyMeta> } {\n const keyParams: Record<string, string[]> = {};\n const keyMeta: Record<string, LabelKeyMeta> = {};\n const planned = new Set(keys);\n for (const [ref, purpose] of Object.entries(FRONTEND_NOTIFICATION_CUSTOM_MESSAGE_PURPOSES)) {\n const message = `${LabellingTypes.NOTIFICATIONS_CUSTOM}.${ref}.msg`;\n const nextStep = `${LabellingTypes.NOTIFICATIONS_CUSTOM}.${ref}.nextStepLabel`;\n if (planned.has(message)) keyMeta[message] = { purpose: `${purpose} This key is the notice's message.` };\n if (planned.has(nextStep)) keyMeta[nextStep] = { purpose: `${purpose} This key is the label of the notice's button, which opens what the notice is about.` };\n }\n for (const [ref, meanings] of Object.entries(FRONTEND_NOTIFICATION_CUSTOM_MESSAGE_PARAMS)) {\n const key = `${LabellingTypes.NOTIFICATIONS_CUSTOM}.${ref}.msg`;\n if (!meanings || !planned.has(key)) continue;\n keyParams[key] = Object.keys(meanings);\n keyMeta[key] = { ...keyMeta[key], paramMeanings: meanings };\n }\n return { keys, keyParams, keyMeta };\n}\n\n/**\n * Plans the labelling work as a flat list of `LabellingUnit`s.\n *\n * Responsibilities:\n * - Walk every source of labels (components registry, resource registry,\n * theme catalogs, milestones, billing, roles, lifecycle, guidance,\n * backend messages, additional refs).\n * - Group keys by unit + sub-group (so one component / one resource /\n * one theme bucket = one unit).\n * - Chunk each sub-group at `MAX_ITEMS_PER_CHUNK` so each LLM call stays\n * bounded (and the structured-output schema fits).\n * - Provide a lazy `loadSpecContext` that the orchestrator triggers\n * only when a unit is actually about to be sent to the LLM.\n *\n * This service is purely a planner — it does NOT generate, write, or\n * translate anything. The orchestrators consume `LabellingUnit[]` and\n * decide what to do (labellize / translate / skip based on the lock).\n */\n@injectable()\nexport class LabellingPlannerCompanionService {\n private readonly logDebug: (message: string, context?: Record<string, unknown>) => void;\n private guidanceFlowProvider: () => ReadonlyArray<GuidanceFlowDefinition> = () => [];\n private guidanceFlowProviderRegistered = false;\n\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.ResourceRegistryService) private readonly resourcesRegistryService: ResourcesRegistryBackendService,\n @inject(COMPANION_SERVICE_TYPES.LabellingSpecContextLoader) private readonly specContextLoader: LabellingSpecContextLoaderCompanionService,\n @inject(COMPANION_SERVICE_TYPES.ComponentLabelsBootstrapService) private readonly componentLabelsBootstrap: ComponentLabelsBootstrapCompanionService,\n @inject(COMPANION_SERVICE_TYPES.CompanionContext) private readonly companionContext: CompanionContext,\n @inject(COMPANION_SERVICE_TYPES.IntrospectionService) private readonly introspectionService: CompanionIntrospectionService,\n // #1921 — the application's configuration, for vocabularies whose values it declares there (reason codes).\n @inject(SAAS_SERVICE_TYPES.AppConfigService) @optional() private readonly appConfigService?: AppConfigurationService,\n ) {\n this.logDebug = this.logger.debugByType('LabellingPlannerService');\n }\n\n /**\n * Wire the app-level guidance-flow provider (OVERRIDE owner for app-level\n * `module.guidanceFlows` labels). When an app registers a provider the planner\n * trusts it as the single source of guidance-flow keys. When NO provider is\n * registered the planner falls back to frontend-module discovery (the\n * `frontend-labels-needed-info` behavior), so app-level guidance-flow labels\n * are still generated. Onboarding-view labels always come from discovery\n * regardless — they are not part of this provider contract.\n */\n public setGuidanceFlowProvider(provider: () => ReadonlyArray<GuidanceFlowDefinition>): void {\n this.guidanceFlowProvider = provider;\n this.guidanceFlowProviderRegistered = true;\n }\n\n /**\n * Plan all units in dependency-free order.\n *\n * Hydrates the decentralized component-labels registry on first call\n * (via static `.tsx` scan, no module loading). Idempotent — subsequent\n * calls are cheap.\n */\n public async planAllUnits(): Promise<LabellingUnit[]> {\n return (await this.planAllUnitsWithCompleteness()).units;\n }\n\n /**\n * `planAllUnits()` plus the explicit answer to \"was every family able to\n * enumerate itself?\".\n *\n * Generation only ever needs the units — a family that could not answer\n * contributes no work and the run proceeds, which is why `planAllUnits()`\n * exists and stays the default. Any consumer that reasons about ABSENCE\n * (nothing planned this bucket ⇒ the bucket is stale) needs the second half,\n * because the two situations produce a byte-identical unit list: an\n * application with no composite views, and an application whose frontend\n * introspection could not run. See `LabellingPlanIncompletenessReason`.\n */\n public async planAllUnitsWithCompleteness(): Promise<LabellingPlanResult> {\n await this.componentLabelsBootstrap.hydrateOnce();\n // Plan from the specifications as they stand NOW, not as the companion first read them (#1115).\n await this.specContextLoader.refreshIfSpecificationsChanged();\n const incompleteness: LabellingPlanIncompleteness[] = [];\n\n // Run the frontend introspection subprocess ONCE per plan; both\n // `planFrontendDerivedUnits` and `planAppGuidanceUnit` consume the snapshot.\n const frontend = await this.collectFrontendDerivedLabelKeys();\n if (frontend.incompleteness) incompleteness.push(frontend.incompleteness);\n const frontendDerived = frontend.snapshot;\n // Partial only when the snapshot should have answered — see `resolveFrontendPlanDegradation`.\n const frontendPlanDegradation = resolveFrontendPlanDegradation(frontend.incompleteness);\n\n // Milestone and product DECLARATIONS come from ONE introspection snapshot, not from the runtime registries\n // `startApplication()` fills — see MILESTONE_INTROSPECTION_FAILED and PRODUCT_CATALOG_INTROSPECTION_FAILED. A zero\n // there is authoritative; only a failed (or stale) introspection degrades a family.\n const { milestones, products, declaredResourceTypes: listedResourceTypes } = await this.collectRegistryDeclarations();\n // Every application registers the engine's own resources (users, organizations…), so an EMPTY list is a registry\n // that failed to load in the subprocess, never an application with nothing to label: it reads as unreadable, or a\n // stale companion would compare against nothing and report itself current (#2504 review).\n const declaredResourceTypes = listedResourceTypes !== undefined && listedResourceTypes.length > 0 ? listedResourceTypes : undefined;\n if (milestones.incompleteness) incompleteness.push(milestones.incompleteness);\n if (products.incompleteness) incompleteness.push(products.incompleteness);\n // The same snapshot lists the resource types the application declares NOW (#2504): the boot-time registry can lag it.\n const staleRegistry = this.detectStaleResourceRegistry(declaredResourceTypes);\n if (staleRegistry) incompleteness.push(staleRegistry);\n if (declaredResourceTypes === undefined) {\n incompleteness.push({\n reason: LabellingPlanIncompletenessReason.RESOURCE_REGISTRY_UNREADABLE,\n detail: 'The resources-registry introspection did not answer with the resource types the application declares, so '\n + \"whether the companion's registry lags the application cannot be told. Repair the introspection (wildo context health) and run the labels again.\",\n suppressedBuckets: ['resources'],\n });\n }\n\n // An unreadable specification registry reads as \"no specification\" for every resource, which plans back every\n // description a specification decided against — see RESOURCE_SPECIFICATIONS_UNAVAILABLE.\n const specsLoadFailure = await this.specContextLoader.resourceSpecificationsLoadFailure();\n const specsIncompleteness: LabellingPlanIncompleteness | undefined = specsLoadFailure === undefined\n ? undefined\n : {\n reason: LabellingPlanIncompletenessReason.RESOURCE_SPECIFICATIONS_UNAVAILABLE,\n detail: `The resource-specification registry could not be loaded: ${specsLoadFailure}`,\n suppressedBuckets: ['resources'],\n };\n if (specsIncompleteness) incompleteness.push(specsIncompleteness);\n\n // The same for the composite-view registry (#3233): a section description is planned only when its specification\n // documents one, and an unreadable registry would plan them all, so the composite-views unit is tagged and refused.\n const compositeSpecsLoadFailure = await this.specContextLoader.compositeViewSpecificationsLoadFailure();\n const compositeSpecsIncompleteness: LabellingPlanIncompleteness | undefined = compositeSpecsLoadFailure === undefined\n ? undefined\n : {\n reason: LabellingPlanIncompletenessReason.COMPOSITE_VIEW_SPECIFICATIONS_UNAVAILABLE,\n detail: `The composite-view specification registry could not be loaded: ${compositeSpecsLoadFailure}`,\n suppressedBuckets: ['composite_views'],\n };\n if (compositeSpecsIncompleteness) incompleteness.push(compositeSpecsIncompleteness);\n\n // The same for the roles (#3258), asked before the plan reads the role registry: see `roleSpecificationsLoadFailure`.\n const roleSpecsLoadFailure = await this.specContextLoader.roleSpecificationsLoadFailure();\n const roleSpecsIncompleteness: LabellingPlanIncompleteness | undefined = roleSpecsLoadFailure === undefined\n ? undefined\n : {\n reason: LabellingPlanIncompletenessReason.ROLE_SPECIFICATIONS_UNAVAILABLE,\n detail: `The application's roles could not all be read: ${roleSpecsLoadFailure}`,\n suppressedBuckets: ['roles'],\n };\n if (roleSpecsIncompleteness) incompleteness.push(roleSpecsIncompleteness);\n\n // The pause states approval gates declare (#1864), worded in the `system_enums` theme unit. A failed read tags\n // that unit so no write prunes the pause-state words it could not see.\n const gates = await this.collectHumanDecisionGateDeclarations();\n if (gates.incompleteness) incompleteness.push(gates.incompleteness);\n\n // The application's own tools (#2551), worded in their own bucket. A failed read plans no unit and suppresses the\n // bucket, so the words already generated there are neither pruned nor reported as orphans.\n const functionTools = await this.collectFunctionToolDeclarations();\n if (functionTools.incompleteness) incompleteness.push(functionTools.incompleteness);\n\n // Vendor names (#1895): read once here, so the incompleteness and the unit come from the SAME reading.\n // A failed reading of either half also TAGS the providers unit (`providersPlanDegradation`): the bucket suppression\n // only spares orphan files, while the unit's own file is rewritten from its plan, so a partial plan would delete the\n // missing providers' words in the primary locale and translate would prune them in every other one (#3196 review).\n const providersPlanDegradation: LabellingPlanIncompletenessReason[] = [];\n const declaredProviders = this.readDeclaredProviderPopulation();\n if (declaredProviders.unreadable.length > 0) {\n providersPlanDegradation.push(LabellingPlanIncompletenessReason.PROVIDER_RUNTIME_ARTIFACTS_UNREADABLE);\n incompleteness.push({\n reason: LabellingPlanIncompletenessReason.PROVIDER_RUNTIME_ARTIFACTS_UNREADABLE,\n detail:\n 'Provider runtime artifact(s) could not be read, so vendor names may be missing for the providers they declare: ' +\n declaredProviders.unreadable.map((entry) => `${entry.kind} (${entry.path}): ${entry.detail}`).join('; ') +\n '. Run `wildo config sync`.',\n suppressedBuckets: [PROVIDERS_LABEL_BUCKET],\n });\n }\n // The words of each declared provider's typed credential fields (#3196), read for the SAME refs.\n const credentialFields = await this.collectProviderCredentialFields(declaredProviders.refs);\n if (credentialFields.unreadable !== undefined) {\n providersPlanDegradation.push(LabellingPlanIncompletenessReason.PROVIDER_CREDENTIAL_FIELDS_UNREADABLE);\n incompleteness.push({\n reason: LabellingPlanIncompletenessReason.PROVIDER_CREDENTIAL_FIELDS_UNREADABLE,\n detail: `The providers' credential fields could not all be read (${credentialFields.unreadable}), so a field's words may be missing. `\n + 'Run `wildo config sync` and `pnpm install`, then run the labels again.',\n suppressedBuckets: [PROVIDERS_LABEL_BUCKET],\n });\n }\n\n const plannedUnits: LabellingUnit[] = [\n ...this.planComponentUnits(),\n ...(await this.planResourceUnits(frontendDerived, frontendPlanDegradation, specsIncompleteness)),\n ...this.planErrorsMessagesUnit(),\n ...(await this.planErrorsRefusalsUnit()),\n ...this.planThemeUnits(gates),\n ...(await this.planFrontendDerivedUnits(frontendDerived, compositeSpecsIncompleteness)),\n ...this.planEnginePageUnits(),\n ...this.planMilestoneUnits(milestones.definitions),\n ...this.planBillingUnit(products.definitions, products.featureDefinitions),\n ...this.planProvidersUnit(declaredProviders.refs, credentialFields.fieldsByRef, providersPlanDegradation, credentialFields.connectionParameterNamesByRef, credentialFields.vendorRegistrationStepsByRef),\n ...this.planSystemsOfRecordUnit(),\n ...this.planAuditPayloadFieldsUnit(),\n ...(await this.planFlowsActorsToolsUnit(functionTools.tools)),\n ...(await this.planRolesUnit(roleSpecsIncompleteness)),\n ...this.planLifecycleUnit(),\n ...(await this.planAppGuidanceUnit(frontendDerived, frontendPlanDegradation)),\n ...this.planAdditionalUnit(),\n ];\n // Generation order is visibility order (#3232): what the application's author defined first, so a run cut short has\n // spent its time on the words a user of the application meets. Each family above keeps its own order inside a tier.\n const units = orderLabellingUnitsByVisibility(plannedUnits);\n this.logDebug('Planned units', {\n total: units.length,\n byCategory: countByCategory(units),\n incompleteness: incompleteness.map((entry) => entry.reason),\n });\n return { units, incompleteness };\n }\n\n // ================================================================\n // Frontend-derived label families (composite views, navigation views,\n // sidebar sections).\n //\n // These families are authored ENTIRELY in the frontend app\n // (composite/full-custom/flows-actors view components, the sidebar\n // `contentSections` config + per-module `sidebarSections`). Their label keys\n // can only be computed by loading the frontend modules — a Vite/`.ts` source\n // graph the companion MAIN process cannot import. The\n // `frontend-labels-needed-info` introspection behavior runs in the companion\n // SUBPROCESS (the one with the Node-bridge loader) and is the single source of\n // truth for frontend-derived label keys — see\n // `frontend-labels-needed-info.behavior.ts`.\n //\n // This method consumes ONLY the three frontend-ONLY namespaces below from the\n // snapshot's `appSpecificLabelKeys`. `resources.*` and resource-scoped\n // `guidance.*` are ALSO present in `appSpecificLabelKeys` but are DROPPED here\n // — they are materialized by `planResourceUnits` off the backend resources\n // registry (taking them here too would double-generate). The exception is a\n // field's description and tooltip keys, which only this snapshot can see;\n // `planResourceUnits` reads those from `appSpecificLabelKeys` itself\n // (`addFrontendFieldTextKeys`). App-level guidance\n // flows and onboarding views arrive on dedicated snapshot fields\n // (`appLevelGuidanceFlowLabelKeys` / `onboardingViewLabelKeys`) and are owned\n // by `planAppGuidanceUnit`, NOT here. `engine.pages.*` is framework-fixed and\n // sourced by `planEnginePageUnits`.\n // ================================================================\n\n private async planFrontendDerivedUnits(\n derived: FrontendDerivedLabelKeys,\n /** Set when the composite-view specifications could not be read (#3233): the composite-views unit is then refused. */\n compositeSpecificationsIncompleteness?: LabellingPlanIncompleteness,\n ): Promise<LabellingUnit[]> {\n const frontendKeys = derived.appSpecificLabelKeys;\n if (frontendKeys.length === 0) return [];\n\n const families: Array<FrontendDerivedFamilyDescriptor & { keyParams?: Record<string, string[]> }> =\n FRONTEND_DERIVED_FAMILIES.map((family) => ({\n ...family,\n // Custom execution-view labels carry interpolation params; thread them so\n // the labellize prompt enforces the placeholder contract (mirrors the\n // components bucket). chunkKeys applies each entry only to its own key.\n ...(family.category === LabellingUnitCategory.VIEW ? { keyParams: derived.viewLabelParams } : {}),\n // A composite view's own declared labels carry params too (#2263); absent from a stale snapshot.\n ...(family.category === LabellingUnitCategory.COMPOSITE_VIEW && derived.compositeViewLabelParams\n ? { keyParams: derived.compositeViewLabelParams }\n : {}),\n }));\n\n const units: LabellingUnit[] = [];\n for (const family of families) {\n const familyKeys = frontendKeys.filter((key) => key.startsWith(family.prefix));\n // A composite SECTION description is optional: planned only when its specification documents one.\n const keys = family.category === LabellingUnitCategory.COMPOSITE_VIEW\n ? await this.specContextLoader.filterUndocumentedCompositeSectionDescriptions(familyKeys)\n : familyKeys;\n if (keys.length === 0) continue;\n // Composite-view + non-composite-view (full-custom / flows-actors / chart /\n // execution) + sidebar-section title/description keys have authored per-slot\n // purposes in their spec registries — project them so the labellize prompt\n // carries real wording intent instead of the LLM inventing filler from the\n // ref alone.\n const keyMeta = family.category === LabellingUnitCategory.COMPOSITE_VIEW\n ? await this.specContextLoader.projectCompositeViewKeyMeta(keys)\n : family.category === LabellingUnitCategory.VIEW\n ? await this.specContextLoader.projectViewKeyMeta(keys)\n : family.category === LabellingUnitCategory.SIDEBAR_SECTIONS_ROOT\n ? await this.specContextLoader.projectSidebarSectionKeyMeta(keys)\n : family.category === LabellingUnitCategory.SETTINGS_HUB_ROOT\n ? Object.fromEntries(\n keys\n .filter(key => derived.settingsHubKeyMeta?.[key] !== undefined)\n .map(key => [key, { purpose: `Rail label for this settings destination. The application currently words it \"${derived.settingsHubKeyMeta?.[key]}\" — preserve that meaning and register; do not substitute the technical ref or an acronym.` }]),\n )\n : family.category === LabellingUnitCategory.COMMAND_CATEGORIES_ROOT\n ? Object.fromEntries(keys.map((key) => [key, {\n purpose: `Heading of one group in the command menu (Cmd+K): the commands or searched records the application files under the category \"${key.split('.')[1]}\". A short noun phrase naming what the group holds, as a menu heading; never the raw category ref or an abbreviation of it.`,\n }]))\n : undefined;\n // A view or composite label's declared `isCount` params (#2263) join whatever the specification\n // projected for the same key, so the generator writes plural forms for an application's own labels.\n const keyMetaWithCounts = family.category === LabellingUnitCategory.VIEW\n ? withDeclaredLabelCountParams(keys, keyMeta, derived.viewLabelCountParams)\n : family.category === LabellingUnitCategory.COMPOSITE_VIEW\n ? withDeclaredLabelCountParams(keys, keyMeta, derived.compositeViewLabelCountParams)\n : keyMeta;\n units.push({\n category: family.category,\n id: family.id,\n displayLabel: family.displayLabel,\n filePathHint: { bucket: family.bucket, slug: 'root' },\n chunks: chunkKeys(family.id, keys, family.keyParams, keyMetaWithCounts),\n // Keys carry enough semantics (translationRef / section ref) for the LLM\n // to label from the identifier even when no keyMeta is projected.\n loadSpecContext: async () => undefined,\n ...(family.category === LabellingUnitCategory.COMPOSITE_VIEW && compositeSpecificationsIncompleteness\n ? { plannedFromIncompleteInputs: [compositeSpecificationsIncompleteness.reason] }\n : {}),\n });\n }\n return units;\n }\n\n /**\n * Invoke the `frontend-labels-needed-info` introspection behavior against the\n * app frontend service and return its full key snapshot: `appSpecificLabelKeys`\n * plus the two dedicated app-level guidance fields\n * (`appLevelGuidanceFlowLabelKeys`, `onboardingViewLabelKeys`).\n *\n * Returns an EMPTY snapshot (with a logged warning) when there is no SAAS_APP\n * frontend service or the subprocess fails/returns a malformed payload —\n * frontend-derived labels are best-effort and must never take down the whole\n * plan (which also feeds backend-only label generation). Payload shaping +\n * stale-subprocess tolerance lives in `parseFrontendDerivedLabelSnapshot`.\n */\n private async collectFrontendDerivedLabelKeys(): Promise<{\n snapshot: FrontendDerivedLabelKeys;\n /** Set on EVERY degraded path — the three empty-snapshot returns below. */\n incompleteness?: LabellingPlanIncompleteness;\n }> {\n const appFrontendServiceKey = Object.entries(this.companionContext.servicesByKey)\n .find(([, service]) => service.frontendType === AppFrontendType.SAAS_APP)?.[0];\n\n if (!appFrontendServiceKey) {\n this.logDebug('No SAAS_APP frontend service found; skipping frontend-derived label keys.');\n return {\n snapshot: EMPTY_FRONTEND_DERIVED_LABEL_KEYS,\n incompleteness: {\n reason: LabellingPlanIncompletenessReason.FRONTEND_INTROSPECTION_NO_APP_SERVICE,\n detail: 'No SAAS_APP frontend service is configured.',\n suppressedBuckets: FRONTEND_DERIVED_LABEL_BUCKETS,\n },\n };\n }\n\n // Verified against the source (#2504 review): a cached snapshot predating a new sidebar section plans without it.\n const result = await this.introspectionService.requestInfo({\n serviceKey: appFrontendServiceKey,\n behavior: 'frontend-labels-needed-info',\n }, { verifyAgainstSource: true });\n\n if (!result.success) {\n const message = 'error' in result ? result.error.message : 'unknown error';\n this.logger.warn(\n `frontend-labels-needed-info introspection failed; frontend-derived labels skipped: ${message}`,\n { serviceKey: appFrontendServiceKey },\n );\n return {\n snapshot: EMPTY_FRONTEND_DERIVED_LABEL_KEYS,\n incompleteness: {\n reason: LabellingPlanIncompletenessReason.FRONTEND_INTROSPECTION_FAILED,\n detail: `frontend-labels-needed-info introspection failed on '${appFrontendServiceKey}': ${message}`,\n suppressedBuckets: FRONTEND_DERIVED_LABEL_BUCKETS,\n },\n };\n }\n\n const snapshot = parseFrontendDerivedLabelSnapshot(result.data);\n if (!snapshot) {\n this.logger.warn('frontend-labels-needed-info returned no appSpecificLabelKeys array; frontend-derived labels skipped.');\n return {\n snapshot: EMPTY_FRONTEND_DERIVED_LABEL_KEYS,\n incompleteness: {\n reason: LabellingPlanIncompletenessReason.FRONTEND_INTROSPECTION_MALFORMED,\n detail: `frontend-labels-needed-info on '${appFrontendServiceKey}' returned no appSpecificLabelKeys array.`,\n suppressedBuckets: FRONTEND_DERIVED_LABEL_BUCKETS,\n },\n };\n }\n\n return { snapshot };\n }\n\n // ================================================================\n // Components — one unit per FrontendComponentType\n // ================================================================\n\n private planComponentUnits(): LabellingUnit[] {\n const registry = getRegisteredComponentLabels();\n\n const units: LabellingUnit[] = [];\n for (const [componentType, defs] of registry.entries()) {\n const keys = defs\n .map((d) => (typeof d === 'string' ? d : d?.ref))\n .filter((k): k is string => typeof k === 'string' && k.length > 0)\n .map((subKey) => `${LabellingTypes.COMPONENTS}.${componentType}.${subKey}`);\n\n if (keys.length === 0) continue;\n\n // Thread each label's DECLARED interpolation params (full key → param\n // names) so the labellize prompt can instruct the agent to emit EXACTLY\n // those single-brace placeholders (root-cause fix for the historical\n // `{value}` drift) and the post-generation validator can flag mismatches.\n // Object-form params (`{ key, isLabelled, … }`) collapse to their `key`;\n // plain-string defs and defs without params contribute no entry.\n const keyParams: Record<string, string[]> = {};\n for (const d of defs) {\n if (typeof d === 'string' || !d?.ref || !d.params || d.params.length === 0) continue;\n const paramNames = d.params\n .map((p) => (typeof p === 'string' ? p : p?.key))\n .filter((p): p is string => typeof p === 'string' && p.length > 0);\n if (paramNames.length === 0) continue;\n keyParams[`${LabellingTypes.COMPONENTS}.${componentType}.${d.ref}`] = paramNames;\n }\n\n // Thread the enriched per-key SEMANTIC metadata (purpose / kind / per-param\n // meaning / notes) authored in the component's `.labels.ts` def, so the\n // labellize + translate prompts get authoritative per-key context instead\n // of name-inference. Sparse: only keys that authored metadata get an entry.\n const keyMeta: Record<string, LabelKeyMeta> = {};\n for (const d of defs) {\n if (typeof d === 'string' || !d?.ref) continue;\n const paramMeanings: Record<string, string> = {};\n for (const p of d.params ?? []) {\n if (typeof p !== 'string' && p?.key && p.meaning) paramMeanings[p.key] = p.meaning;\n }\n const countParams = readDeclaredCountParams(d.params);\n const meta: LabelKeyMeta = {\n ...(d.purpose ? { purpose: d.purpose } : {}),\n ...(d.kind ? { kind: d.kind } : {}),\n ...(Object.keys(paramMeanings).length > 0 ? { paramMeanings } : {}),\n ...(countParams.length > 0 ? { countParams } : {}),\n ...(d.notes && d.notes.length > 0 ? { notes: d.notes } : {}),\n };\n if (Object.keys(meta).length > 0) {\n keyMeta[`${LabellingTypes.COMPONENTS}.${componentType}.${d.ref}`] = meta;\n }\n }\n\n const registeredSubKeys = defs\n .map((d) => (typeof d === 'string' ? d : d?.ref))\n .filter((s): s is string => typeof s === 'string' && s.length > 0);\n\n units.push({\n category: LabellingUnitCategory.COMPONENT,\n id: `component:${componentType}`,\n displayLabel: componentType,\n filePathHint: { bucket: 'components', slug: slugify(componentType) },\n chunks: chunkKeys(componentType, keys, keyParams, keyMeta),\n loadSpecContext: () => this.specContextLoader.loadComponentContext(componentType, registeredSubKeys),\n });\n }\n return units;\n }\n\n // ================================================================\n // Resources — one unit per resource type. Sub-groups: header / operations\n // / emptyState / sections / wizardSteps / groups / fields-block-N.\n // Resource-attached guidance is folded into the resource unit.\n // ================================================================\n\n /**\n * @param frontendIncompleteness Set when the frontend snapshot is the EMPTY fallback of an\n * introspection that should have answered (failed or malformed — never \"no frontend service\", which\n * is complete). Every resource unit then carries it (`plannedFromIncompleteInputs`), because its\n * layout, description opt-in and empty-state secondary-action keys all come from that snapshot and\n * are silently absent.\n * @param specificationsIncompleteness Set when the resource-specification registry could not be loaded\n * (RESOURCE_SPECIFICATIONS_UNAVAILABLE). Every resource unit carries it too: which section and empty-state\n * descriptions to plan is read from the specification, and an unreadable registry would plan them all.\n */\n private async planResourceUnits(\n frontendDerived: FrontendDerivedLabelKeys,\n frontendIncompleteness?: LabellingPlanIncompleteness,\n specificationsIncompleteness?: LabellingPlanIncompleteness,\n ): Promise<LabellingUnit[]> {\n const plannedFromIncompleteInputs = [frontendIncompleteness, specificationsIncompleteness]\n .filter((entry): entry is LabellingPlanIncompleteness => entry !== undefined)\n .map((entry) => entry.reason);\n const registry = this.resourcesRegistryService.getResourcesRegistry();\n // The application's vocabulary only (#3231): the companion's registry also carries the workbench's and the platform\n // plane's resources, which have no surface in the application. Excluded by provenance, in the shared filter.\n const allResources = this.applicationLabelVocabulary(registry.resourceConfigurations as Record<string, AnyResourceConfiguration> | undefined);\n const applicationResourceTypes: ReadonlySet<string> = new Set(registry.applicationResourceTypes ?? []);\n\n const headerDefs = readDefs(LabellingPolicy[LabellingTypes.RESOURCES], 'header');\n const operationsDefs = readDefs(LabellingPolicy[LabellingTypes.RESOURCES], 'operations');\n const emptyStateDefs = readDefs(LabellingPolicy[LabellingTypes.RESOURCES], 'emptyState');\n const sectionDefs = readDefs(LabellingPolicy[LabellingTypes.RESOURCES_SECTIONS], 'section');\n const wizardStepDefs = readDefs(LabellingPolicy[LabellingTypes.RESOURCES_WIZARD_STEPS], 'section');\n const fieldDisplayDefs = readDefs(LabellingPolicy[LabellingTypes.RESOURCES_FIELDS], 'display');\n const fieldEditDefs = readDefs(LabellingPolicy[LabellingTypes.RESOURCES_FIELDS], 'edit');\n const frontendFieldTextKeys = groupFrontendFieldTextKeysByResource(frontendDerived.appSpecificLabelKeys);\n\n const units: LabellingUnit[] = [];\n\n for (const [resourceType, resourceConfig] of Object.entries(allResources)) {\n const subgroups: { id: string; keys: string[] }[] = [];\n\n const headerKeys = headerDefs.map((sub) => `${LabellingTypes.RESOURCES}.${resourceType}.header.${sub}`);\n if (headerKeys.length) subgroups.push({ id: 'header', keys: headerKeys });\n\n const opIds = Array.from(new Set((resourceConfig.operations || []).map((op) => String(op.operationIdentifier))));\n // Per-operation description OPT-IN. The frontend ui-behavior is the ONLY source of\n // `operationFrontendConfig.hasDescription` (the planner main process never sees\n // `operationFrontendConfig` — it carries React components). The subprocess surfaces\n // it via the dedicated `operationDescriptionOptIns` snapshot field (resourceType →\n // opIds). The policy (`operationsDefs`) stays title-only; each flagged op ALSO gets a\n // `.description` key here so it flows through `projectResourceKeyMeta` below for\n // spec-driven copy quality. This is the bridge that lets engine resources (e.g.\n // organizations) — whose ui-behavior the main process cannot import — opt operations\n // into a description. Emitted once, only by the planner (the frontend mirror's\n // `resources.*` keys are dropped), so nothing double-generates.\n const descriptionOptInOpIds = new Set(frontendDerived.operationDescriptionOptIns[resourceType] ?? []);\n const conditionalOpIds = new Set(\n (resourceConfig.operations || [])\n .filter((op) => typeof (op as { enabledCondition?: unknown }).enabledCondition === 'function')\n .map((op) => String(op.operationIdentifier)),\n );\n const opKeys: string[] = [];\n for (const opId of opIds) {\n for (const sub of operationsDefs) {\n opKeys.push(`${LabellingTypes.RESOURCES}.${resourceType}.operations.${opId}.${sub}`);\n }\n if (descriptionOptInOpIds.has(opId)) {\n opKeys.push(`${LabellingTypes.RESOURCES}.${resourceType}.operations.${opId}.${ResourceOperationTextSlot.DESCRIPTION}`);\n }\n // An operation that can be UNAVAILABLE (any variant declares an `enabledCondition`) owes the\n // sentence its action shows when someone asks why it cannot run. Planned from the resource\n // configuration itself, so a condition added tomorrow is planned by construction.\n if (conditionalOpIds.has(opId)) {\n opKeys.push(`${LabellingTypes.RESOURCES}.${resourceType}.operations.${opId}.${ResourceOperationTextSlot.UNAVAILABLE_REASON}`);\n }\n }\n if (opKeys.length) subgroups.push({ id: 'operations', keys: opKeys });\n\n // Empty-state labels apply ONLY to resources that render a collection view (where an\n // empty state can appear) — i.e. resources with a LIST or SEARCH operation. Emitting\n // them for non-collection resources (singletons, nested-only sub-resources, junctions)\n // is pure waste, so gate the whole subgroup on a collection op. Within it, gate per\n // sub-key:\n // - title → always (it falls back to a generic component label in\n // `ResourceEmptyState`, so collection resources keep their\n // resource-specific copy = quality preserved)\n // - description → only when the specification authors `emptyState.purpose` (see\n // `resolveEmptyStateDescriptionAuthored`); with nothing authored it could\n // only restate the header above it or the button beside it. No\n // specification → planned, as before.\n // - (no primary-action key: that action IS the CREATE operation and takes its title)\n // - secondaryActionLabel → only if the frontend declares a `secondaryAction` (the one\n // empty-state label with NO fallback; frontend-only fact bridged\n // via `emptyStateSecondaryActionRefs`)\n // All gates are fail-safe: a wrong skip degrades to a generic fallback, never a broken label.\n const hasCollectionOp =\n opIds.includes(CoreResourceOperation.LIST) || opIds.includes(CoreResourceOperation.SEARCH);\n if (hasCollectionOp) {\n const hasSecondaryActionLabel = frontendDerived.emptyStateSecondaryActionRefs.includes(resourceType);\n const descriptionAuthored = await this.specContextLoader.resolveEmptyStateDescriptionAuthored(resourceType);\n const emptyStateKeys = emptyStateDefs\n .filter((sub) => {\n if (sub === 'secondaryActionLabel') return hasSecondaryActionLabel;\n if (sub === 'description') return descriptionAuthored !== false;\n return true;\n })\n .map((sub) => `${LabellingTypes.RESOURCES}.${resourceType}.emptyState.${sub}`);\n if (emptyStateKeys.length) subgroups.push({ id: 'emptyState', keys: emptyStateKeys });\n }\n\n /*\n * Structural refs come from the SUBPROCESS BRIDGE, not from the registry.\n *\n * `layout.refs` is authored in the ui-behavior, which this process cannot import (it carries\n * React components) — exactly like `operationFrontendConfig.hasDescription` two blocks above.\n * Reading `resourceConfig.frontendConfiguration` here found `undefined` for every resource in\n * every application, so `sectionKeys` was always empty and NO SECTION, WIZARD STEP OR GROUP\n * HAS EVER BEEN LABELLED: measured 2026-09-18, 0 of 315 resource label units across both\n * dogfood applications carried a `sections` block, while `<Section>` resolves\n * `resources.{type}.sections.{ref}.title` and so rendered each raw ref as its own heading.\n *\n * The registry lookup is KEPT as the fallback rather than replaced. Where a materialized\n * config does carry the frontend configuration the two agree, and keeping it means a stale\n * subprocess degrades to today's behaviour instead of a new empty in a different place.\n */\n const layoutRefs = frontendDerived.resourceLayoutRefs[resourceType]\n ?? (resourceConfig as { frontendConfiguration?: { layout?: { refs?: { sections?: string[]; wizardSteps?: string[]; groups?: string[]; filterPresets?: string[] } } } })\n .frontendConfiguration?.layout?.refs;\n\n // A section's description is planned only when its specification documents one: the slot is\n // optional, and an undocumented description would be a model-invented sub-heading restating the\n // title. No specification → both slots, as before (nothing to read the decision from).\n const sectionsWithoutDescription = (layoutRefs?.sections?.length ?? 0) > 0\n ? await this.specContextLoader.resolveSectionRefsWithoutDescription(resourceType)\n : undefined;\n const sectionKeys = planResourceSectionLabelKeys({\n resourceType,\n sectionRefs: layoutRefs?.sections ?? [],\n slotKeys: sectionDefs,\n sectionsWithoutDescription,\n });\n if (sectionKeys.length) subgroups.push({ id: 'sections', keys: sectionKeys });\n\n const wizardKeys: string[] = [];\n for (const stepRef of layoutRefs?.wizardSteps ?? []) {\n for (const sub of wizardStepDefs) {\n wizardKeys.push(`${LabellingTypes.RESOURCES}.${resourceType}.wizardSteps.${stepRef}.${sub}`);\n }\n }\n if (wizardKeys.length) subgroups.push({ id: 'wizardSteps', keys: wizardKeys });\n\n const groupKeys: string[] = (layoutRefs?.groups ?? []).map(\n (gRef) => `${LabellingTypes.RESOURCES}.${resourceType}.groups.${gRef}.title`,\n );\n if (groupKeys.length) subgroups.push({ id: 'groups', keys: groupKeys });\n\n /*\n * Collection FILTER PRESETS — the pills above a list (\"Urgent\", \"Created today\").\n *\n * Same source and same reason as the three axes above: the refs are authored in the\n * ui-behavior (`views → collectionDisplayConfig.presetFilters`), which only the subprocess\n * can import, and a preset with no authored label renders its raw `ref` — so an unplanned\n * preset is a pill reading `created-today` in every locale.\n *\n * No registry fallback beside it, unlike `layoutRefs`: `presetFilters` is frontend-only and\n * has never been carried on `frontendConfiguration`, so there is no second place that could\n * agree or disagree.\n */\n const filterPresetKeys: string[] = (layoutRefs?.filterPresets ?? []).map(\n (presetRef) => `${LabellingTypes.RESOURCES}.${resourceType}.filterPresets.${presetRef}.label`,\n );\n if (filterPresetKeys.length) subgroups.push({ id: 'filterPresets', keys: filterPresetKeys });\n\n const fieldKeys = extractResourceFieldKeys({\n resourceType,\n resourceConfig,\n displayDefs: fieldDisplayDefs,\n editDefs: fieldEditDefs,\n });\n addFrontendFieldTextKeys(fieldKeys, frontendFieldTextKeys.get(resourceType));\n if (fieldKeys.length) subgroups.push({ id: 'fields', keys: fieldKeys });\n\n // Resource-attached guidance flows fold in under `guidance` subgroup\n // (resource-scoped). Root-level guidance lives in its own root unit.\n const resourceGuidanceKeys = collectResourceGuidanceKeys(resourceType, resourceConfig);\n if (resourceGuidanceKeys.length) subgroups.push({ id: 'guidance', keys: resourceGuidanceKeys });\n\n // Resource-attached milestones (milestones whose definition references\n // this resource) will be folded into the unit by Phase 2 once the\n // milestone-definition cross-index is exposed by the registry.\n\n // Project per-key meaning (kind + purpose) from the resource spec onto its\n // label keys — the resource analogue of the component `.labels.ts` keyMeta.\n const allKeys = subgroups.flatMap((sg) => sg.keys);\n const keyMeta = await this.specContextLoader.projectResourceKeyMeta(resourceType, allKeys);\n // Ephemeral fields (one-time secrets like an API key's `plainKey`) live only\n // in a customResponseDto, so the spec-driven projection above can't see them.\n // Project framework-general keyMeta from the `.isEphemeral()` marker itself —\n // a user-facing label (\"API key\", not \"Plain key\") + a \"copy it now, shown\n // once\" description — merged OVER the heuristic for those keys.\n Object.assign(keyMeta, buildEphemeralFieldKeyMeta({ resourceType, resourceConfig }));\n const chunks = subgroupsToChunks(resourceLabellingUnitId(resourceType), subgroups, keyMeta);\n if (chunks.length === 0) continue;\n\n units.push({\n category: LabellingUnitCategory.RESOURCE,\n id: resourceLabellingUnitId(resourceType),\n displayLabel: resourceType,\n filePathHint: { bucket: 'resources', slug: resourceLabellingUnitSlug(resourceType) },\n chunks,\n loadSpecContext: () => this.specContextLoader.loadResourceContext(resourceType),\n resourceProvenance: classifyLabellingResourceProvenance(resourceType, applicationResourceTypes),\n ...(plannedFromIncompleteInputs.length > 0 ? { plannedFromIncompleteInputs } : {}),\n });\n }\n return units;\n }\n\n // ================================================================\n // Themes — grouped buckets (errors_messages, errors_guidance, etc.)\n // ================================================================\n\n private planThemeUnits(gates: { pauseStates: readonly string[]; incompleteness?: LabellingPlanIncompleteness }): LabellingUnit[] {\n // `errors_guidance` is the one theme bucket that declares interpolation\n // params (e.g. `retryCountdown → [\"seconds\"]`); thread them so regeneration\n // seeds the placeholder and the drift validator covers it like components.\n const errorsGuidance = this.collectErrorsGuidanceKeys();\n // NOTE: `errors_messages` is intentionally NOT in this generic theme loop.\n // It has its own `planErrorsMessagesUnit()` so it can project per-ref\n // `purpose` + `audience` from the error-message specs (the theme loop is\n // deliberately audience-less / keyMeta-less for the other buckets).\n const themes: { themeId: string; keys: string[]; keyParams?: Record<string, string[]>; keyMeta?: Record<string, LabelKeyMeta> }[] = [\n { themeId: 'errors_guidance', keys: errorsGuidance.keys, keyParams: errorsGuidance.keyParams, keyMeta: errorsGuidance.keyMeta },\n { themeId: 'errors_validation', keys: this.collectErrorsValidationKeys() },\n { themeId: 'notifications_custom', ...this.collectNotificationsCustomTheme() },\n { themeId: 'system_enums', keys: this.collectSystemEnumsKeys(gates.pauseStates) },\n { themeId: 'backend_auth_messages', keys: this.collectBackendAuthMessagesKeys() },\n { themeId: 'backend_sms', keys: this.collectBackendSmsKeys() },\n { themeId: 'backend_documents', ...this.collectBackendDocumentsTheme() },\n ];\n\n const units: LabellingUnit[] = [];\n for (const { themeId, keys, keyParams, keyMeta } of themes) {\n if (keys.length === 0) continue;\n units.push({\n category: themeId.startsWith('backend_') ? LabellingUnitCategory.BACKEND_MESSAGES : LabellingUnitCategory.THEME,\n id: `theme:${themeId}`,\n displayLabel: themeId,\n filePathHint: { bucket: 'themes', slug: themeId },\n chunks: chunkKeys(themeId, keys, keyParams, keyMeta),\n loadSpecContext: async () => undefined,\n // The pause-state words live in `system_enums`: planned without them, the unit holds a subset (#1864).\n ...(themeId === 'system_enums' && gates.incompleteness ? { plannedFromIncompleteInputs: [gates.incompleteness.reason] } : {}),\n });\n }\n return units;\n }\n\n // ================================================================\n // Engine pages — one root unit listing the `i18nKey` of every engine\n // page enumerated in `ENGINE_PAGE_METADATA` (HOME, SECURITY_SETTINGS, …).\n //\n // Engine pages are framework-owned navigation targets; the metadata\n // record is the canonical source of truth for both routing and label\n // resolution (see `launcher-items.frontend.schemas.ts:ENGINE_PAGE_METADATA`).\n // The runtime label lookup uses `ctx.t(metadata.i18nKey)`, and the\n // i18n key itself is already a full dotted path (e.g.\n // `engine.pages.home`) — emit `<i18nKey>.title` per page.\n // ================================================================\n\n private planEnginePageUnits(): LabellingUnit[] {\n const entries = Object.values(ENGINE_PAGE_METADATA);\n if (entries.length === 0) return [];\n\n const keys: string[] = [];\n for (const metadata of entries) {\n keys.push(`${metadata.i18nKey}.title`);\n }\n\n return [{\n category: LabellingUnitCategory.ENGINE_PAGES_ROOT,\n id: 'engine-pages:root',\n displayLabel: 'engine pages',\n filePathHint: { bucket: 'engine_pages', slug: 'root' },\n chunks: chunkKeys('engine-pages', keys),\n // Engine pages have stable, app-agnostic semantics (Home, Security\n // Settings, …). The keys alone are enough for label generation;\n // rich context could be added later if app-specific tone is required.\n loadSpecContext: async () => undefined,\n }];\n }\n\n /**\n * The milestone and product DECLARATIONS, read from ONE `resources-registry` introspection of the application's\n * shared modules.\n *\n * Both families used to be planned from runtime registries — `MilestoneDefinitionRegistry` and\n * `ProductCatalogSyncBackendService` — whose only writer is `startApplication()`, which the companion never runs.\n * Each answered `[]` for every application, and the family disappeared with nothing reported: Wonder Todos declares\n * eight milestones and planned none (#1405), and no application ever had a plan name labelled (found by #1881's\n * regeneration).\n *\n * Reading declarations restores the distinction the old predicates claimed but could not have: an application that\n * declares no milestones or sells nothing answers an AUTHORITATIVE zero, and only a failed introspection degrades.\n * Each projection degrades on its own: a subprocess predating one projection carries the other.\n */\n private async collectRegistryDeclarations(): Promise<{\n milestones: { definitions: readonly LabellingMilestoneDefinition[]; incompleteness?: LabellingPlanIncompleteness };\n products: {\n definitions: readonly LabellingProductDefinition[];\n featureDefinitions: readonly LabellingFeatureDefinition[];\n incompleteness?: LabellingPlanIncompleteness;\n };\n /** The resource types the application declares NOW, read fresh by the subprocess (#2504); absent when it did not answer. */\n declaredResourceTypes?: readonly string[];\n }> {\n const milestoneDegraded = (detail: string) => {\n this.logger.warn(`Milestone label planning skipped: ${detail}`);\n return {\n definitions: [],\n incompleteness: { reason: LabellingPlanIncompletenessReason.MILESTONE_INTROSPECTION_FAILED, detail, suppressedBuckets: ['milestones'] },\n };\n };\n const productDegraded = (detail: string) => {\n this.logger.warn(`Billing label planning skipped: ${detail}`);\n return {\n definitions: [],\n featureDefinitions: [],\n incompleteness: { reason: LabellingPlanIncompletenessReason.PRODUCT_CATALOG_INTROSPECTION_FAILED, detail, suppressedBuckets: ['billing'] },\n };\n };\n\n const backendServiceKey = Object.entries(this.companionContext.servicesByKey)\n .find(([, service]) => !service.frontendType)?.[0];\n if (!backendServiceKey) {\n const detail = 'No backend service is configured to answer the resources-registry introspection.';\n return { milestones: milestoneDegraded(detail), products: productDegraded(detail) };\n }\n\n // Verified against the source, not a cached answer (#2504 review): the labels step decides from what this says is absent.\n const result = await this.introspectionService.requestInfo({\n serviceKey: backendServiceKey,\n behavior: 'resources-registry',\n }, { verifyAgainstSource: true });\n if (!result.success) {\n const message = 'error' in result ? result.error.message : 'unknown error';\n const detail = `resources-registry introspection failed on '${backendServiceKey}': ${message}`;\n return { milestones: milestoneDegraded(detail), products: productDegraded(detail) };\n }\n const data = result.data as { customMilestoneDefinitions?: unknown; productDefinitions?: unknown; customFeatureDefinitions?: unknown; resourceTypes?: unknown } | undefined;\n const declaredResourceTypes = Array.isArray(data?.resourceTypes)\n ? data.resourceTypes.filter((entry): entry is string => typeof entry === 'string')\n : undefined;\n\n // A snapshot produced BEFORE a projection existed carries no key for it. That is a stale subprocess, not an\n // application without milestones or products, so it degrades rather than reporting zero.\n const stale = (projection: string) =>\n `resources-registry on '${backendServiceKey}' returned no ${projection} array (a subprocess predating the projection, or a malformed payload).`;\n\n let milestones: { definitions: readonly LabellingMilestoneDefinition[]; incompleteness?: LabellingPlanIncompleteness };\n if (!Array.isArray(data?.customMilestoneDefinitions)) {\n milestones = milestoneDegraded(stale('customMilestoneDefinitions'));\n } else {\n const definitions: LabellingMilestoneDefinition[] = [];\n for (const entry of data.customMilestoneDefinitions) {\n const candidate = entry as Partial<LabellingMilestoneDefinition>;\n if (typeof candidate?.identifier !== 'string' || candidate.identifier.length === 0) continue;\n definitions.push({\n identifier: candidate.identifier,\n hasDescriptionLabel: candidate.hasDescriptionLabel === true,\n ...(typeof candidate.category === 'string' ? { category: candidate.category } : {}),\n });\n }\n this.logDebug(`Milestone declarations read from introspection: ${definitions.length}`);\n milestones = { definitions };\n }\n\n let products: {\n definitions: readonly LabellingProductDefinition[];\n featureDefinitions: readonly LabellingFeatureDefinition[];\n incompleteness?: LabellingPlanIncompleteness;\n };\n if (!Array.isArray(data?.productDefinitions)) {\n products = productDegraded(stale('productDefinitions'));\n } else if (!Array.isArray(data?.customFeatureDefinitions)) {\n // The same bucket: a feature's words live beside a plan's, so a plan read without the features is not total.\n products = productDegraded(stale('customFeatureDefinitions'));\n } else {\n const strings = (value: unknown): string[] => (Array.isArray(value) ? value.filter((item): item is string => typeof item === 'string') : []);\n const definitions: LabellingProductDefinition[] = [];\n for (const entry of data.productDefinitions) {\n const candidate = entry as Partial<LabellingProductDefinition>;\n if (typeof candidate?.key !== 'string' || candidate.key.length === 0) continue;\n definitions.push({\n key: candidate.key,\n grantedFeatures: strings(candidate.grantedFeatures),\n grantedLimitKeys: strings(candidate.grantedLimitKeys),\n ...(typeof candidate.creditPoolKey === 'string' && candidate.creditPoolKey.length > 0 ? { creditPoolKey: candidate.creditPoolKey } : {}),\n });\n }\n this.logDebug(`Product declarations read from introspection: ${definitions.length}`);\n products = { definitions, featureDefinitions: this.readDeclaredFeatureDefinitions(data.customFeatureDefinitions) };\n }\n\n return { milestones, products, ...(declaredResourceTypes === undefined ? {} : { declaredResourceTypes }) };\n }\n\n /**\n * The resource types the application declares that the companion's registry does not carry (#2504), as an\n * incompleteness. `undefined` when the two agree, or when the fresh list could not be read (nothing to compare).\n */\n private detectStaleResourceRegistry(declaredResourceTypes: readonly string[] | undefined): LabellingPlanIncompleteness | undefined {\n if (declaredResourceTypes === undefined) return undefined;\n const registered = new Set(Object.keys(this.resourcesRegistryService.getResourcesRegistry().resourceConfigurations ?? {}));\n const missing = declaredResourceTypes.filter((resourceType) => !registered.has(resourceType) && !isCompanionOnlyResourceType(resourceType));\n if (missing.length === 0) return undefined;\n return {\n reason: LabellingPlanIncompletenessReason.RESOURCE_REGISTRY_STALE,\n detail: `The companion's resource registry, loaded when it started, lacks ${missing.length} resource type(s) the application `\n + `now declares: ${missing.join(', ')}. Restart the companion so it reloads the application's registry, then run the labels again.`,\n suppressedBuckets: ['resources'],\n expectedUnitHints: missing.map((resourceType) => ({ bucket: 'resources', slug: resourceLabellingUnitSlug(resourceType) })),\n };\n }\n\n private planMilestoneUnits(definitions: readonly LabellingMilestoneDefinition[]): LabellingUnit[] {\n if (definitions.length === 0) return [];\n\n const keys: string[] = [];\n const uniqueCategories = new Set<string>();\n for (const def of definitions) {\n keys.push(`${LabellingTypes.MILESTONES}.${def.identifier}.title`);\n if (def.hasDescriptionLabel) keys.push(`${LabellingTypes.MILESTONES}.${def.identifier}.description`);\n if (def.category) uniqueCategories.add(def.category);\n keys.push(`${LabellingTypes.MILESTONES}.${def.identifier}.reward.title`);\n keys.push(`${LabellingTypes.MILESTONES}.${def.identifier}.reward.message`);\n }\n for (const cat of uniqueCategories) {\n keys.push(`${LabellingTypes.MILESTONES}.categories.${cat}.label`);\n }\n\n return [{\n category: LabellingUnitCategory.MILESTONES_ROOT,\n id: 'milestones:root',\n displayLabel: 'milestones',\n filePathHint: { bucket: 'milestones', slug: 'root' },\n chunks: chunkKeys('milestones', keys),\n loadSpecContext: async () => undefined,\n }];\n }\n\n /**\n * Every declared feature and limit (#1851): the engine's core definitions plus the application's own, as projected by\n * the introspection. A custom definition repeating a core identifier contributes nothing new.\n */\n private readDeclaredFeatureDefinitions(customDefinitions: readonly unknown[]): LabellingFeatureDefinition[] {\n const valueTypes = new Set<string>(Object.values(FeatureValueType));\n const declared = new Map<string, LabellingFeatureDefinition>();\n for (const definition of CORE_FEATURE_DEFINITIONS) {\n declared.set(definition.identifier, { identifier: definition.identifier, valueType: definition.valueType });\n }\n for (const entry of customDefinitions) {\n const candidate = entry as Partial<LabellingFeatureDefinition>;\n if (typeof candidate?.identifier !== 'string' || candidate.identifier.length === 0) continue;\n if (typeof candidate.valueType !== 'string' || !valueTypes.has(candidate.valueType)) continue;\n declared.set(candidate.identifier, { identifier: candidate.identifier, valueType: candidate.valueType });\n }\n this.logDebug(`Feature declarations: ${declared.size} (core and custom)`);\n return [...declared.values()];\n }\n\n /**\n * The billing words: each product's name, description and tagline, the words of every FEATURE and LIMIT, and each\n * credit pool's. Features and limits are planned from every declaration (`featureDefinitions`, #1851), and also from\n * a product's grants, so a grant naming an undeclared key is still worded rather than left raw.\n */\n private planBillingUnit(definitions: readonly LabellingProductDefinition[], featureDefinitions: readonly LabellingFeatureDefinition[]): LabellingUnit[] {\n if (definitions.length === 0 && featureDefinitions.length === 0) return [];\n\n const keys: string[] = [];\n const featureKeys = new Set<string>();\n const limitKeys = new Set<string>();\n const creditPoolKeys = new Set<string>();\n\n for (const feature of featureDefinitions) {\n if (feature.valueType === FeatureValueType.LIMIT) limitKeys.add(feature.identifier);\n else featureKeys.add(feature.identifier);\n }\n for (const def of definitions) {\n keys.push(`${LabellingTypes.BILLING_PRODUCTS}.${def.key}.name`);\n keys.push(`${LabellingTypes.BILLING_PRODUCTS}.${def.key}.description`);\n keys.push(`${LabellingTypes.BILLING_PRODUCTS}.${def.key}.tagline`);\n for (const f of def.grantedFeatures) featureKeys.add(f);\n for (const l of def.grantedLimitKeys) limitKeys.add(l);\n if (def.creditPoolKey) creditPoolKeys.add(def.creditPoolKey);\n }\n for (const f of featureKeys) {\n keys.push(`${LabellingTypes.BILLING_FEATURES}.${f}.label`);\n keys.push(`${LabellingTypes.BILLING_FEATURES}.${f}.description`);\n }\n for (const l of limitKeys) {\n keys.push(`${LabellingTypes.BILLING_LIMITS}.${l}.label`);\n keys.push(`${LabellingTypes.BILLING_LIMITS}.${l}.description`);\n keys.push(`${LabellingTypes.BILLING_LIMITS}.${l}.unit`);\n }\n for (const p of creditPoolKeys) {\n keys.push(`${LabellingTypes.BILLING_CREDIT_POOLS}.${p}.name`);\n keys.push(`${LabellingTypes.BILLING_CREDIT_POOLS}.${p}.description`);\n keys.push(`${LabellingTypes.BILLING_CREDIT_POOLS}.${p}.unit`);\n }\n\n return [{\n category: LabellingUnitCategory.BILLING,\n id: 'billing:root',\n displayLabel: 'billing',\n filePathHint: { bucket: 'billing', slug: 'root' },\n chunks: chunkKeys('billing', keys),\n loadSpecContext: async () => undefined,\n }];\n }\n\n /**\n * Vendor display names — `providers.<ref>.displayName` for every provider the application declares (#1895).\n *\n * One unit for the whole family: the keys are one-word brand names, so a unit per vendor would be dozens of model\n * calls for a few dozen words. The population and each key's intent are derived in\n * `provider-display-name-keys.utils.ts`; the ref is passed as intent, never as the word.\n */\n private readDeclaredProviderPopulation(): DeclaredProviderRefsReading {\n return readDeclaredProviderRefs(this.companionContext.saasRoot);\n }\n\n /**\n * The typed credential fields each declared provider publishes (#3196), read through provider discovery. See\n * `provider-credential-field-keys.utils.ts`. A seam, so a test plans the family without a real discovery walk.\n */\n private async collectProviderCredentialFields(refs: readonly string[]): Promise<DeclaredProviderCredentialFieldsReading> {\n return readDeclaredProviderCredentialFields({ saasRoot: this.companionContext.saasRoot, saasConfig: this.companionContext.saasConfig, refs });\n }\n\n /**\n * @param planDegradation The reasons either half of the population could not be read (an unreadable runtime artifact,\n * an unreadable provider discovery). Non-empty means the unit holds a SUBSET of its real keys, so it carries them as\n * `plannedFromIncompleteInputs` and every write path refuses it rather than prune the words it could not plan.\n */\n private planProvidersUnit(\n refs: readonly string[],\n credentialFieldsByRef: Readonly<Record<string, readonly DeclaredProviderCredentialField[]>> = {},\n planDegradation: readonly LabellingPlanIncompletenessReason[] = [],\n connectionParameterNamesByRef: Readonly<Record<string, readonly string[]>> = {},\n vendorRegistrationStepsByRef: Readonly<Record<string, readonly DeclaredProviderVendorRegistrationStep[]>> = {},\n ): LabellingUnit[] {\n const names = planProviderDisplayNameKeys(refs);\n // One unit for the vendor's words: its name, its credential fields' words (#3196) and its connection parameters'\n // words (#3251), one model call.\n const fields = planProviderCredentialFieldKeys(credentialFieldsByRef);\n const parameters = planProviderConnectionParameterKeys(connectionParameterNamesByRef);\n // And the vendor-registration steps an organization reads (#3252), each with the placeholders its words carry.\n const steps = planProviderVendorRegistrationStepKeys(vendorRegistrationStepsByRef);\n const keys = [...names.keys, ...fields.keys, ...parameters.keys, ...steps.keys];\n const keyMeta = { ...names.keyMeta, ...fields.keyMeta, ...parameters.keyMeta, ...steps.keyMeta };\n if (keys.length === 0) return [];\n return [{\n category: LabellingUnitCategory.PROVIDERS_ROOT,\n id: `${PROVIDERS_LABEL_BUCKET}:root`,\n displayLabel: 'provider names, connect-form fields and registration steps',\n filePathHint: { bucket: PROVIDERS_LABEL_BUCKET, slug: 'root' },\n chunks: chunkKeys(PROVIDERS_LABEL_BUCKET, keys, steps.keyParams, keyMeta),\n loadSpecContext: async () => ({ audience: LabelAudience.END_USER }),\n ...(planDegradation.length > 0 ? { plannedFromIncompleteInputs: [...planDegradation] } : {}),\n }];\n }\n\n /**\n * System-of-record instance names — `systems_of_record.<name>.displayName` for every instance the application declares\n * (#1997). One unit for the family, like the vendor names: a handful of names, one model call. The population is the\n * loaded saas configuration's `systemsOfRecord` block, and each key carries the name and vendor as intent only.\n */\n private planSystemsOfRecordUnit(): LabellingUnit[] {\n const { keys, keyMeta } = planSystemOfRecordDisplayNameKeys(\n readDeclaredSystemOfRecordInstances(this.companionContext.saasConfig?.systemsOfRecord),\n );\n if (keys.length === 0) return [];\n return [{\n category: LabellingUnitCategory.SYSTEMS_OF_RECORD_ROOT,\n id: `${SYSTEMS_OF_RECORD_LABEL_BUCKET}:root`,\n displayLabel: 'system-of-record names',\n filePathHint: { bucket: SYSTEMS_OF_RECORD_LABEL_BUCKET, slug: 'root' },\n chunks: chunkKeys(SYSTEMS_OF_RECORD_LABEL_BUCKET, keys, undefined, keyMeta),\n loadSpecContext: async () => ({ audience: LabelAudience.END_USER }),\n }];\n }\n\n /**\n * Typed audit payload field words — `audit_payload_fields.<path>.label` for every field path the engine's typed audit\n * payloads declare (#3168). Planned for every application, unconditionally, like the payload vocabularies: every\n * application records these events, and the audit log's payload card names each value it lists by this key. Chunked\n * like any large unit; each key carries the intent derived from the schemas (the events recording the field, the\n * shape of its value), never the word.\n */\n private planAuditPayloadFieldsUnit(): LabellingUnit[] {\n const { keys, keyMeta } = planAuditPayloadFieldLabelKeys();\n if (keys.length === 0) return [];\n return [{\n category: LabellingUnitCategory.AUDIT_PAYLOAD_FIELDS_ROOT,\n id: `${AUDIT_PAYLOAD_FIELDS_LABEL_BUCKET}:root`,\n displayLabel: 'audit event detail names',\n filePathHint: { bucket: AUDIT_PAYLOAD_FIELDS_LABEL_BUCKET, slug: 'root' },\n chunks: chunkKeys(AUDIT_PAYLOAD_FIELDS_LABEL_BUCKET, keys, undefined, keyMeta),\n loadSpecContext: async () => ({ audience: LabelAudience.ADMIN }),\n }];\n }\n\n /**\n * An application's own tools — `flows_actors_tools.<model tool name>.{title,working}` for every function tool its\n * backend modules register (#2551). One unit for the family, like the vendor names: two short phrases per tool. The\n * population and each key's intent are derived in `function-tool-label-keys.utils.ts`; the tool's description is passed\n * as intent, never as the words.\n */\n private async planFlowsActorsToolsUnit(tools: readonly DeclaredFunctionTool[]): Promise<LabellingUnit[]> {\n const wordFiles = this.toolResourceWordFiles(tools);\n const chunksFrom = async (readLabels: (filePath: string) => Promise<Record<string, string>>): Promise<LabellingUnitChunk[]> => {\n const words = wordFiles === undefined\n ? {}\n : await applicationResourceWords({\n resourceTypes: wordFiles.resourceTypes,\n resourceLabelFilePath: wordFiles.filePathOf,\n readLabels,\n onUnreadable: (resourceType, error) => this.logger.warn(\n `The label file of resource \"${resourceType}\" could not be read, so its tools are worded from the resource type: ${describeCaughtError(error)}`,\n ),\n });\n const { keys, keyMeta } = planFunctionToolLabelKeys(tools, words);\n return keys.length === 0 ? [] : chunkKeys(FLOWS_ACTORS_TOOLS_LABEL_BUCKET, keys, undefined, keyMeta);\n };\n const chunks = await chunksFrom(readPerUnitLabels);\n if (chunks.length === 0) return [];\n return [{\n category: LabellingUnitCategory.FLOWS_ACTORS_TOOLS_ROOT,\n id: `${FLOWS_ACTORS_TOOLS_LABEL_BUCKET}:root`,\n displayLabel: 'assistant tool names',\n filePathHint: { bucket: FLOWS_ACTORS_TOOLS_LABEL_BUCKET, slug: 'root' },\n chunks,\n loadSpecContext: async () => ({ audience: LabelAudience.END_USER }),\n // The resource words above are the previous run's; a labels run generates this unit after the resources it names\n // and re-plans it from their words as this run left them (#3253).\n ...(wordFiles === undefined ? {} : {\n wordedFromUnits: {\n afterUnitIds: wordFiles.resourceTypes.map(resourceLabellingUnitId),\n replanChunks: chunksFrom,\n },\n }),\n }];\n }\n\n /**\n * Where the application's own word for each resource a tool acts on lives (#3253): its primary-locale resource label\n * file. `undefined` when no tool names a resource, or the i18n root or the primary locale cannot be resolved: the\n * tools are then named by resource type.\n */\n private toolResourceWordFiles(tools: readonly DeclaredFunctionTool[]): { resourceTypes: string[]; filePathOf: (resourceType: string) => string } | undefined {\n const resourceTypes = [...new Set(tools.flatMap((tool) => (tool.resourceType === undefined ? [] : [tool.resourceType])))];\n if (resourceTypes.length === 0 || this.companionContext === undefined) return undefined;\n const i18nRoot = resolveApplicationI18nRoot(this.companionContext);\n if (i18nRoot === undefined || !this.appConfigService?.isInitialized?.()) return undefined;\n let primaryLocale: string;\n try {\n primaryLocale = getCompanionConfiguredPrimaryLanguage(this.appConfigService.config);\n } catch {\n return undefined;\n }\n return {\n resourceTypes,\n filePathOf: (resourceType) => path.join(i18nRoot, 'resources', `${resourceLabellingUnitSlug(resourceType)}.${primaryLocale}.ts`),\n };\n }\n\n /**\n * `errors_messages` theme unit — split out of the generic theme loop so it\n * can project per-ref `purpose` + `audience` from the authored\n * error-message specs (the errors-side twin of `planRolesUnit`). User-facing\n * error copy is then generated from intent instead of guessed from the bare\n * key string; internal refs (no spec) fall back to token-only generation.\n * Keeps the same unit id / output file (`themes/errors_messages.<locale>.ts`)\n * as before, so the lock + served bundle location are unchanged.\n */\n private planErrorsMessagesUnit(): LabellingUnit[] {\n const keys = this.collectErrorsMessagesKeys();\n if (keys.length === 0) return [];\n const keyMeta = this.specContextLoader.projectErrorMessageKeyMeta(keys);\n return [{\n category: LabellingUnitCategory.THEME,\n id: 'theme:errors_messages',\n displayLabel: 'errors_messages',\n filePathHint: { bucket: 'themes', slug: 'errors_messages' },\n chunks: chunkKeys('errors_messages', keys, undefined, keyMeta),\n // Most authored error messages are consumer-facing, so default the unit\n // to the END_USER register; per-ref ADMIN / DEVELOPER references override\n // it through their own `keyMeta.audience`.\n loadSpecContext: async () => ({ audience: LabelAudience.END_USER }),\n }];\n }\n\n /**\n * Words for every DECLARED refusal code (#1048) — `errors_refusals.<CODE>.msg`, total over the\n * `errorScenarios[].errorCode` values the resource specifications declare (see\n * `collectDeclaredRefusals` for the one exclusion). Each key's generation context is the `when`\n * text the specification authored, which for a custom refusal usually names the remedy — the sentence\n * a form used to drop on the floor.\n */\n private async planErrorsRefusalsUnit(): Promise<LabellingUnit[]> {\n const refusals = await this.specContextLoader.loadDeclaredRefusals();\n if (refusals.length === 0) return [];\n const keys: string[] = [];\n const keyMeta: Record<string, LabelKeyMeta> = {};\n for (const refusal of refusals) {\n const key = refusalLabelKey(refusal.code);\n keys.push(key);\n const purpose = refusalLabelPurpose(refusal.when);\n keyMeta[key] = {\n kind: LabelKind.MESSAGE,\n audience: LabelAudience.END_USER,\n ...(purpose !== undefined ? { purpose } : {}),\n };\n }\n return [{\n category: LabellingUnitCategory.THEME,\n id: `theme:${LabellingTypes.ERRORS_REFUSALS}`,\n displayLabel: LabellingTypes.ERRORS_REFUSALS,\n filePathHint: { bucket: 'themes', slug: LabellingTypes.ERRORS_REFUSALS },\n chunks: chunkKeys(LabellingTypes.ERRORS_REFUSALS, keys, undefined, keyMeta),\n loadSpecContext: async () => ({ audience: LabelAudience.END_USER }),\n }];\n }\n\n private async planRolesUnit(incompleteness?: LabellingPlanIncompleteness): Promise<LabellingUnit[]> {\n const keys = collectRoleKeys();\n if (keys.length === 0) return [];\n // Project per-role `label` / `description` keyMeta from the authored role\n // specs. Engine baseline + app-defined roles share one flat namespace, so\n // custom app roles (e.g. `CUSTOM_APP_MANAGER`) get accurate, spec-driven\n // labels instead of token-only generation. See `projectRoleKeyMeta`.\n const keyMeta = await this.specContextLoader.projectRoleKeyMeta(keys);\n return [{\n category: LabellingUnitCategory.ROLES,\n id: 'roles:root',\n displayLabel: 'roles',\n filePathHint: ROLE_LABELLING_UNIT_FILE_PATH_HINT,\n chunks: chunkKeys('roles', keys, undefined, keyMeta),\n ...(incompleteness ? { plannedFromIncompleteInputs: [incompleteness.reason] } : {}),\n // Roles are an access-control / permission vocabulary surfaced in\n // member-management, role pickers, and permission chips — an operator\n // concern. Calibrate the generator to the ADMIN register (clean console\n // terms + authority-focused descriptions) rather than the END_USER default.\n loadSpecContext: async () => ({ audience: LabelAudience.ADMIN }),\n }];\n }\n\n private planLifecycleUnit(): LabellingUnit[] {\n const keys = collectLifecycleKeys();\n if (keys.length === 0) return [];\n return [{\n category: LabellingUnitCategory.LIFECYCLE,\n id: 'lifecycle:root',\n displayLabel: 'lifecycle',\n filePathHint: { bucket: 'lifecycle', slug: 'root' },\n chunks: chunkKeys('lifecycle', keys),\n loadSpecContext: async () => undefined,\n }];\n }\n\n /**\n * App-level guidance-namespace unit (`guidance.<ref>.*`) covering BOTH:\n * - app-level guidance flows (`module.guidanceFlows`): sourced from the\n * registered `setGuidanceFlowProvider` when present (the OVERRIDE owner),\n * else from frontend-module discovery (`appLevelGuidanceFlowLabelKeys`);\n * - onboarding views (`module.onboardingViews`): ALWAYS from frontend-module\n * discovery (`onboardingViewLabelKeys`) — they share the `guidance.*`\n * namespace but have no provider contract, so the provider override must\n * never suppress them.\n *\n * Resource-scoped guidance lives inside the corresponding resource unit\n * (`planResourceUnits`), NOT here. See `resolveAppLevelGuidanceLabelKeys` for\n * the override + de-duplication rule.\n */\n private async planAppGuidanceUnit(\n derived: FrontendDerivedLabelKeys,\n frontendIncompleteness?: LabellingPlanIncompleteness,\n ): Promise<LabellingUnit[]> {\n const keys = resolveAppLevelGuidanceLabelKeys({\n guidanceFlowProviderRegistered: this.guidanceFlowProviderRegistered,\n providerGuidanceFlowKeys: collectAppGuidanceKeys(this.guidanceFlowProvider()),\n discoveredGuidanceFlowKeys: derived.appLevelGuidanceFlowLabelKeys,\n onboardingViewKeys: derived.onboardingViewLabelKeys,\n });\n if (keys.length === 0) return [];\n // App-level onboarding views + guidance flows author per-slot + per-element\n // purposes in their specs (keyed `app.<ref>`). Project them onto the bare-ref\n // `guidance.<ref>.*` keys so the modal/flow copy reflects authored intent\n // instead of generic filler (\"Utilize AI to enhance your workflow\").\n const keyMeta = await this.specContextLoader.projectGuidanceKeyMeta(keys);\n return [{\n category: LabellingUnitCategory.GUIDANCE_ROOT,\n id: 'guidance:root',\n displayLabel: 'guidance',\n filePathHint: { bucket: 'guidance', slug: 'root' },\n chunks: chunkKeys('guidance', keys, undefined, keyMeta),\n loadSpecContext: async () => undefined,\n // The discovered flow and onboarding-view keys come from the frontend snapshot; the\n // provider-registered ones do not, so a degraded run still plans a unit — a partial one.\n ...(frontendIncompleteness ? { plannedFromIncompleteInputs: [frontendIncompleteness.reason] } : {}),\n }];\n }\n\n private planAdditionalUnit(): LabellingUnit[] {\n const keys = [...additionalLabelsRefs];\n if (keys.length === 0) return [];\n return [{\n category: LabellingUnitCategory.ADDITIONAL,\n id: 'additional:root',\n displayLabel: 'additional',\n filePathHint: { bucket: 'themes', slug: 'additional' },\n chunks: chunkKeys('additional', keys),\n loadSpecContext: async () => undefined,\n }];\n }\n\n // ================================================================\n // Theme key collectors\n // ================================================================\n\n private collectErrorsMessagesKeys(): string[] {\n const sectionConfig = LabellingPolicy[LabellingTypes.ERRORS_MESSAGES] as Record<string, LabellingUnitaryDef[]>;\n const displayDefs = readDefs(sectionConfig as unknown as Record<string, LabellingUnitaryDef[]>, 'display');\n const keys: string[] = [];\n for (const ref of Object.values(ErrorCustomMessageReference) as string[]) {\n for (const sub of displayDefs) {\n keys.push(`${LabellingTypes.ERRORS_MESSAGES}.${ref}.${sub}`);\n }\n }\n return keys;\n }\n\n private collectErrorsGuidanceKeys(): { keys: string[]; keyParams: Record<string, string[]>; keyMeta: Record<string, LabelKeyMeta> } {\n // Per-field declared params live in `LabellingPolicy[ERRORS_GUIDANCE].display`\n // (e.g. `retryCountdown → [\"seconds\"]`); `ERROR_GUIDANCE_REFS` only lists\n // which fields each ref needs. Build a field→params map, then attach it to\n // every `errors_guidance.<ref>.<field>` key whose field declares params.\n const displayDefs =\n (LabellingPolicy[LabellingTypes.ERRORS_GUIDANCE] as Record<string, LabellingUnitaryDef[]> | undefined)?.['display'] ?? [];\n const fieldParams: Record<string, string[]> = {};\n const fieldCountParams: Record<string, string[]> = {};\n for (const def of displayDefs) {\n if (typeof def === 'string' || !def?.ref || !def.params || def.params.length === 0) continue;\n const params = def.params\n .map((p) => (typeof p === 'string' ? p : p?.key))\n .filter((p): p is string => typeof p === 'string' && p.length > 0);\n if (params.length > 0) fieldParams[def.ref] = params;\n const countParams = readDeclaredCountParams(def.params);\n if (countParams.length > 0) fieldCountParams[def.ref] = countParams;\n }\n\n const keys: string[] = [];\n const keyParams: Record<string, string[]> = {};\n const keyMeta: Record<string, LabelKeyMeta> = {};\n for (const [ref, fields] of Object.entries(ERROR_GUIDANCE_REFS)) {\n for (const field of fields) {\n const key = `${LabellingTypes.ERRORS_GUIDANCE}.${ref}.${field}`;\n keys.push(key);\n const params = fieldParams[field];\n if (params) keyParams[key] = params;\n const countParams = fieldCountParams[field];\n if (countParams) keyMeta[key] = { countParams };\n }\n }\n return { keys, keyParams, keyMeta };\n }\n\n private collectErrorsValidationKeys(): string[] {\n const sectionConfig = LabellingPolicy[LabellingTypes.ERRORS_VALIDATION] as Record<string, LabellingUnitaryDef[]> | undefined;\n if (!sectionConfig) return [];\n const keys: string[] = [];\n for (const issueCode of Object.keys(sectionConfig)) {\n for (const def of sectionConfig[issueCode] || []) {\n const sub = typeof def === 'string' ? def : def?.ref;\n if (sub) keys.push(`${LabellingTypes.ERRORS_VALIDATION}.${issueCode}.${sub}`);\n }\n }\n return keys;\n }\n\n /**\n * The `notifications_custom` theme: the in-app notices (`collectNotificationsCustomKeys`, with the engine notices'\n * declared purposes and parameters) and the SMS notification texts (#1875, `collectSmsNotificationLabelKeys`, each with\n * its declared purpose, parameters and the one-segment length rule). One theme, because both are keyed by the\n * notification identifier and an identifier may carry both.\n */\n private collectNotificationsCustomTheme(): { keys: string[]; keyParams: Record<string, string[]>; keyMeta: Record<string, LabelKeyMeta> } {\n const inApp = notificationsCustomKeyParams(this.collectNotificationsCustomKeys());\n const registry = this.resourcesRegistryService.getResourcesRegistry();\n const sms = collectSmsNotificationLabelKeys(Object.values(\n this.applicationLabelVocabulary(registry.resourceConfigurations as Record<string, AnyResourceConfiguration> | undefined),\n ) as Parameters<typeof collectSmsNotificationLabelKeys>[0]);\n return {\n keys: [...inApp.keys, ...sms.keys],\n keyParams: { ...inApp.keyParams, ...sms.keyParams },\n keyMeta: { ...inApp.keyMeta, ...sms.keyMeta },\n };\n }\n\n private collectNotificationsCustomKeys(): string[] {\n const keys: string[] = [];\n const seen = new Set<string>();\n const registry = this.resourcesRegistryService.getResourcesRegistry();\n // The application's own notices only (#3231): a workbench operation's notice is the companion's word, not the application's.\n const allResources = this.applicationLabelVocabulary(registry.resourceConfigurations as Record<string, AnyResourceConfiguration> | undefined);\n\n for (const resourceConfig of Object.values(allResources)) {\n for (const op of resourceConfig.operations || []) {\n const notifs = (op as { userNotifications?: Array<{ channel: string; identifier: string; nextStep?: unknown }> }).userNotifications;\n if (!notifs) continue;\n for (const n of notifs) {\n if (n.channel !== 'front_end_success') continue;\n if (!n.identifier || seen.has(n.identifier)) continue;\n seen.add(n.identifier);\n keys.push(`${LabellingTypes.NOTIFICATIONS_CUSTOM}.${n.identifier}.msg`);\n if (n.nextStep) keys.push(`${LabellingTypes.NOTIFICATIONS_CUSTOM}.${n.identifier}.nextStepLabel`);\n }\n }\n }\n\n const sectionConfig = LabellingPolicy[LabellingTypes.NOTIFICATIONS_CUSTOM] as Record<string, LabellingUnitaryDef[]> | undefined;\n const displayDefs = readDefs(sectionConfig as unknown as Record<string, LabellingUnitaryDef[]>, 'display');\n for (const ref of Object.values(FrontendNotificationCustomMessageRefs) as string[]) {\n if (seen.has(ref)) continue;\n seen.add(ref);\n for (const sub of displayDefs) {\n keys.push(`${LabellingTypes.NOTIFICATIONS_CUSTOM}.${ref}.${sub}`);\n }\n }\n return keys;\n }\n\n /**\n * The `system_enums.<EnumName>.<value>` keys, DERIVED — see `buildSystemEnumLabelKeys` for\n * its four sources and the ordering contract.\n *\n * This method used to be nine literal `push(...)` calls: a hand-kept copy of another\n * module's catalogue, and the exact shape that rots. It had rotted twice by the time it was\n * measured (2026-09-08):\n *\n * - `SystemEnumName.DURATION_UNIT` was declared in `presets-components-models` and absent\n * from the list, so a `z_duration()` unit was planned nowhere;\n * - ten vocabularies decorated with `.systemEnum('X')` on real resource schemas — the\n * seven billing ones plus `PlatformAccessGrantStatus`,\n * `PlatformAccessGrantAutoApprovalReason` and `DurationUnit` — were SUPPRESSED from\n * per-field labelling by `extractResourceFieldKeys` on the promise that they would be\n * labelled here, and were not. `tResourceFieldEnumValue` then falls through to step 3 of\n * its cascade and renders the raw wire value, so a subscription badge read `past_due`\n * and a product type read `one_time` in the generated dogfood application.\n *\n * The derivation lives beside `extractResourceFieldKeys` rather than here precisely because\n * those are the two halves that have to agree; keeping them in one module is what lets one\n * test assert the invariant between them.\n */\n private collectSystemEnumsKeys(pauseStates: readonly string[]): string[] {\n const registry = this.resourcesRegistryService.getResourcesRegistry();\n // The application's vocabularies only (#3231): an enum only a workbench resource declares is the companion's word.\n const allResources = this.applicationLabelVocabulary(registry.resourceConfigurations as Record<string, AnyResourceConfiguration> | undefined);\n const applicationVocabularies = collectApplicationConfigSystemEnumVocabularies(this.readApplicationConfig());\n // The gates' pause states (#1864): declared in the backend modules rather than the configuration, same vocabulary family.\n if (pauseStates.length > 0) applicationVocabularies.set(ApplicationConfigVocabulary.HUMAN_DECISION_PAUSE_STATE, [...new Set(pauseStates)]);\n return buildSystemEnumLabelKeys(Object.values(allResources), applicationVocabularies);\n }\n\n /**\n * Every pause state an approval gate declares (#1864), from the backend subprocess (the only place a function tool\n * exists). An application with no backend service has no gates: an authoritative empty answer. A backend that could\n * not answer, or answered without the projection, is a degradation: the plan would otherwise hold no pause-state\n * words and a write would prune them.\n */\n private async collectHumanDecisionGateDeclarations(): Promise<{ pauseStates: readonly string[]; incompleteness?: LabellingPlanIncompleteness }> {\n const degraded = (detail: string) => {\n this.logger.warn(`Pause-state label planning skipped: ${detail}`);\n return {\n pauseStates: [],\n incompleteness: { reason: LabellingPlanIncompletenessReason.HUMAN_DECISION_GATES_INTROSPECTION_FAILED, detail, suppressedBuckets: [] },\n };\n };\n const backendServiceKey = Object.entries(this.companionContext.servicesByKey)\n .find(([, service]) => !service.frontendType)?.[0];\n if (!backendServiceKey) return { pauseStates: [] };\n\n const result = await this.introspectionService.requestInfo({ serviceKey: backendServiceKey, behavior: 'human-decision-gate-declarations' });\n if (!result.success) {\n const message = 'error' in result ? result.error.message : 'unknown error';\n return degraded(`human-decision-gate-declarations introspection failed on '${backendServiceKey}': ${message}`);\n }\n const gates = (result.data as { gates?: unknown } | undefined)?.gates;\n if (!Array.isArray(gates)) {\n return degraded(`human-decision-gate-declarations on '${backendServiceKey}' returned no gates array (a subprocess predating the projection, or a malformed payload).`);\n }\n const pauseStates: string[] = [];\n const unkeyable: string[] = [];\n for (const gate of gates) {\n const states = (gate as { pauseStates?: unknown } | null)?.pauseStates;\n if (!Array.isArray(states)) continue;\n for (const state of states) {\n if (typeof state !== 'string' || state.length === 0) continue;\n // A state that cannot be a key segment is refused at backend startup; the companion may still be reading\n // the declaration, and planning it would nest a key inside the label tree.\n if (isLabelKeySegment(state)) pauseStates.push(state);\n else unkeyable.push(state);\n }\n }\n if (unkeyable.length > 0) {\n return degraded(`pause state(s) ${unkeyable.map((state) => `\"${state}\"`).join(', ')} contain characters a label key segment cannot hold (letters, digits, \"_\" and \"-\" only); the backend refuses them at startup.`);\n }\n this.logDebug(`Pause states read from introspection: ${pauseStates.length}`);\n return { pauseStates };\n }\n\n /**\n * Every function tool the application's backend modules register (#2551), from the backend subprocess (the only place a\n * function tool exists). An application with no backend service has no tools: an authoritative empty answer. A backend\n * that could not answer, or answered without the projection, degrades and suppresses the bucket, so a write cannot prune\n * the tool words it could not see.\n */\n private async collectFunctionToolDeclarations(): Promise<{ tools: readonly DeclaredFunctionTool[]; incompleteness?: LabellingPlanIncompleteness }> {\n const degraded = (detail: string) => {\n this.logger.warn(`Tool label planning skipped: ${detail}`);\n return {\n tools: [],\n incompleteness: { reason: LabellingPlanIncompletenessReason.FUNCTION_TOOLS_INTROSPECTION_FAILED, detail, suppressedBuckets: [FLOWS_ACTORS_TOOLS_LABEL_BUCKET] },\n };\n };\n const backendServiceKey = Object.entries(this.companionContext.servicesByKey)\n .find(([, service]) => !service.frontendType)?.[0];\n if (!backendServiceKey) return { tools: [] };\n\n const result = await this.introspectionService.requestInfo({ serviceKey: backendServiceKey, behavior: 'function-tool-declarations' });\n if (!result.success) {\n const message = 'error' in result ? result.error.message : 'unknown error';\n return degraded(`function-tool-declarations introspection failed on '${backendServiceKey}': ${message}`);\n }\n const tools = readDeclaredFunctionTools(result.data);\n if (!tools) {\n return degraded(`function-tool-declarations on '${backendServiceKey}' returned no tools array (a subprocess predating the projection, or a malformed payload).`);\n }\n this.logDebug(`Function tools read from introspection: ${tools.length}`);\n return { tools };\n }\n\n /**\n * The registry's resources the application owes labels for (#3231): without the companion's own vocabularies, and\n * without the engine resources the application's backend leaves unregistered. The companion assembles its registry\n * with no feature gate, so the gate is applied here, decided by the backend's own `resolveFeatureGatedCoreResourceExclusions`\n * over the application's configuration. An unreadable configuration excludes nothing: the plan then carries words for\n * a few engine resources the application may not register, which costs model calls and never a missing word.\n */\n private applicationLabelVocabulary(resourceConfigurations: Record<string, AnyResourceConfiguration> | undefined): Record<string, AnyResourceConfiguration> {\n return applicationLabelVocabularyResources(resourceConfigurations, this.readFeatureGatedResourceExclusions());\n }\n\n private readFeatureGatedResourceExclusions(): ReadonlySet<string> | undefined {\n try {\n if (!this.appConfigService?.isInitialized?.()) return undefined;\n return resolveFeatureGatedCoreResourceExclusions(this.appConfigService.config);\n } catch {\n return undefined;\n }\n }\n\n /**\n * The application's configuration, or `undefined` before it is initialized. A plan asked for before then plans the\n * framework's vocabularies and the schema-declared ones, and the configuration-declared ones on the next run.\n */\n private readApplicationConfig(): ApplicationConfigVocabularySources | undefined {\n try {\n return this.appConfigService?.isInitialized?.() ? this.appConfigService.config : undefined;\n } catch {\n return undefined;\n }\n }\n\n private collectBackendAuthMessagesKeys(): string[] {\n const sectionConfig = LabellingPolicy[LabellingTypes.BACKEND_AUTH_MESSAGES] as Record<string, LabellingUnitaryDef[]>;\n const displayDefs = readDefs(sectionConfig as unknown as Record<string, LabellingUnitaryDef[]>, 'display');\n const keys: string[] = [];\n for (const ref of Object.values(AuthResponseMessageRef) as string[]) {\n for (const sub of displayDefs) {\n keys.push(`${LabellingTypes.BACKEND_AUTH_MESSAGES}.${ref}.${sub}`);\n }\n }\n return keys;\n }\n\n /**\n * The words of the documents the backend writes itself (#2907): today the approval page of an approved deliverable's\n * manifested copy. Total over the engine's declaration, so a word declared tomorrow is planned with no edit here, each\n * with what it must say and what its parameters mean.\n */\n private collectBackendDocumentsTheme(): { keys: string[]; keyParams: Record<string, string[]>; keyMeta: Record<string, LabelKeyMeta> } {\n const keys: string[] = [];\n const keyParams: Record<string, string[]> = {};\n const keyMeta: Record<string, LabelKeyMeta> = {};\n // Each backend document's words, declared by the engine: the approval page of a manifested copy, and the public\n // verification page its QR code links to (#2907). A word declared tomorrow is planned with no edit here.\n const declared: Array<readonly [string, ApprovalSealManifestationWordDeclaration]> = [\n ...Object.entries(APPROVAL_SEAL_MANIFESTATION_WORDS).map(([word, declaration]) => [approvalSealManifestationWordKey(word as ApprovalSealManifestationWord), declaration] as const),\n ...Object.entries(APPROVAL_SEAL_VERIFICATION_PAGE_WORDS).map(([word, declaration]) => [approvalSealVerificationPageWordKey(word as ApprovalSealVerificationPageWord), declaration] as const),\n ];\n for (const [key, declaration] of declared) {\n keys.push(key);\n if (declaration.params.length > 0) keyParams[key] = [...declaration.params];\n keyMeta[key] = { purpose: declaration.purpose, ...(declaration.paramMeanings ? { paramMeanings: declaration.paramMeanings } : {}) };\n }\n return { keys, keyParams, keyMeta };\n }\n\n private collectBackendSmsKeys(): string[] {\n const sectionConfig = LabellingPolicy[LabellingTypes.BACKEND_SMS] as Record<string, LabellingUnitaryDef[]> | undefined;\n if (!sectionConfig) return [];\n const keys: string[] = [];\n for (const smsRef of Object.keys(sectionConfig)) {\n for (const def of sectionConfig[smsRef] || []) {\n const sub = typeof def === 'string' ? def : def?.ref;\n if (sub) keys.push(`${LabellingTypes.BACKEND_SMS}.${smsRef}.${sub}`);\n }\n }\n return keys;\n }\n\n // ================================================================\n // Helpers\n // ================================================================\n\n}\n\nfunction readDefs(section: Record<string, LabellingUnitaryDef[]> | undefined, key: string): string[] {\n const defs = section?.[key];\n if (!Array.isArray(defs)) return [];\n return defs\n .map((d) => (typeof d === 'string' ? d : d?.ref))\n .filter((s): s is string => typeof s === 'string' && s.length > 0);\n}\n\n/**\n * A field's description and tooltip keys, as the frontend snapshot computed them: `resources.{type}.fields.{path}.\n * {display|edit}.{description|tooltip}`. Capture groups: resource type, field path, mode, text slot.\n */\nconst FRONTEND_FIELD_TEXT_KEY = /^resources\\.([^.]+)\\.fields\\.(.+)\\.(display|edit)\\.(description|tooltip)$/;\n\n/**\n * The field description and tooltip keys the frontend snapshot planned, grouped by resource type.\n *\n * WHY THIS BRIDGE EXISTS. Whether a field shows a description or a tooltip is authored in the\n * resource's ui-behavior (`edit: { showDescription: true }`, a tooltip on the display or edit config),\n * and that config is written onto the FRONTEND registry's schemas, which only the introspection\n * subprocess can build. `extractResourceFieldKeys` asks the same question (`hasDescriptionForEdit`,\n * `hasTooltipForDisplay`, …) of the BACKEND registry's schemas, which do not carry what a ui-behavior writes,\n * so it missed every description and tooltip authored there. The subprocess computes them correctly, and `planFrontendDerivedUnits`\n * drops every `resources.*` key it sends as planner-owned. Same gap as the section and operation\n * description bridges in `planResourceUnits`. Its cost was not only missing words: adoption drops every key the plan no\n * longer holds, so the first run after a unit's inputs changed deleted descriptions a form renders\n * (measured on Wonder Todos 2026-10-29: 205 descriptions and 16 tooltips, e.g. the todo description\n * field's \"Add context with lists, links, or headings.\").\n */\nfunction groupFrontendFieldTextKeysByResource(appSpecificLabelKeys: readonly string[]): Map<string, string[]> {\n const byResource = new Map<string, string[]>();\n for (const key of appSpecificLabelKeys) {\n const match = FRONTEND_FIELD_TEXT_KEY.exec(key);\n if (!match) continue;\n const resourceType = match[1]!;\n const list = byResource.get(resourceType);\n if (list) list.push(key);\n else byResource.set(resourceType, [key]);\n }\n return byResource;\n}\n\n/**\n * Add each frontend-planned description or tooltip key whose field the backend walk planned for the same\n * mode. Keying on the planned `.label` of that field and mode keeps the backend walk the authority on\n * WHICH fields and modes are owed words: a field it does not know, or hides in that mode\n * (`isHiddenForDisplay` / `isHiddenForEdit`), gets no description either. Mutates `fieldKeys` in place.\n */\nfunction addFrontendFieldTextKeys(fieldKeys: string[], frontendKeys: readonly string[] | undefined): void {\n if (!frontendKeys || frontendKeys.length === 0) return;\n const planned = new Set(fieldKeys);\n for (const key of frontendKeys) {\n if (planned.has(key)) continue;\n const labelKey = key.replace(/\\.(description|tooltip)$/, '.label');\n if (!planned.has(labelKey)) continue;\n // Beside its label, so a resource whose field keys span several chunks keeps a field's words together.\n fieldKeys.splice(fieldKeys.indexOf(labelKey) + 1, 0, key);\n planned.add(key);\n }\n}\n\n/**\n * Split a unit's keys into chunks of at most `MAX_ITEMS_PER_CHUNK`, each carrying the output schema the\n * model answers against. Exported for the translate pipeline's email lane (#1908), whose keys come from\n * an authored source file rather than from this planner, so both lanes send the model identically-shaped\n * requests.\n */\nexport function chunkKeys(\n unitId: string,\n keys: string[],\n keyParams?: Record<string, string[]>,\n keyMeta?: Record<string, LabelKeyMeta>,\n): LabellingUnitChunk[] {\n if (keys.length <= MAX_ITEMS_PER_CHUNK) {\n return [makeChunk('all', keys, keyParams, keyMeta)];\n }\n const chunks: LabellingUnitChunk[] = [];\n for (let i = 0; i < keys.length; i += MAX_ITEMS_PER_CHUNK) {\n chunks.push(makeChunk(`chunk-${Math.floor(i / MAX_ITEMS_PER_CHUNK) + 1}`, keys.slice(i, i + MAX_ITEMS_PER_CHUNK), keyParams, keyMeta));\n }\n return chunks;\n}\n\nfunction subgroupsToChunks(\n unitId: string,\n subgroups: { id: string; keys: string[] }[],\n keyMeta?: Record<string, LabelKeyMeta>,\n): LabellingUnitChunk[] {\n const chunks: LabellingUnitChunk[] = [];\n for (const { id, keys } of subgroups) {\n if (keys.length === 0) continue;\n if (keys.length <= MAX_ITEMS_PER_CHUNK) {\n chunks.push(makeChunk(id, keys, undefined, keyMeta));\n } else {\n for (let i = 0; i < keys.length; i += MAX_ITEMS_PER_CHUNK) {\n chunks.push(makeChunk(`${id}-${Math.floor(i / MAX_ITEMS_PER_CHUNK) + 1}`, keys.slice(i, i + MAX_ITEMS_PER_CHUNK), undefined, keyMeta));\n }\n }\n }\n return chunks;\n}\n\nfunction makeChunk(\n chunkId: string,\n keys: string[],\n keyParams?: Record<string, string[]>,\n keyMeta?: Record<string, LabelKeyMeta>,\n): LabellingUnitChunk {\n // Narrow the threaded param + meta maps to THIS chunk's keys — a unit's keys\n // are split across chunks at MAX_ITEMS_PER_CHUNK, so each chunk should only\n // carry what it actually owns (keeps the prompt focused per call).\n let chunkKeyParams: Record<string, string[]> | undefined;\n if (keyParams) {\n for (const k of keys) {\n const params = keyParams[k];\n if (params && params.length > 0) {\n (chunkKeyParams ??= {})[k] = params;\n }\n }\n }\n let chunkKeyMeta: Record<string, LabelKeyMeta> | undefined;\n if (keyMeta) {\n for (const k of keys) {\n const meta = keyMeta[k];\n if (meta) (chunkKeyMeta ??= {})[k] = meta;\n }\n }\n return {\n chunkId,\n keys,\n keyParams: chunkKeyParams,\n keyMeta: chunkKeyMeta,\n buildOutputSchema: (requestedKeys?: readonly string[]) => {\n const owned = new Set(keys);\n const subject = requestedKeys ?? keys;\n const shape: Record<string, z.ZodOptional<z.ZodString>> = {};\n for (const k of subject) {\n // Fail closed on a key this chunk does not own: the agent would happily\n // produce a label for it and the orchestrator would write it into the\n // unit file under a path nothing reads.\n if (!owned.has(k)) throw new Error(`Chunk ${chunkId} was asked to generate a key it does not own: ${k}`);\n // Optional by contract — see `LabellingUnitChunk.buildOutputSchema`.\n shape[k] = z.string().optional();\n }\n return z.object(shape);\n },\n };\n}\n\n/**\n * The params a label declares `isCount` (#2263) — the numbers its words agree with, for which the\n * generator writes plural forms. One reader for every planner site that reads `LabelParamDef`, so a\n * component label and an error-guidance label mean the same thing by the same flag.\n */\nexport function readDeclaredCountParams(params: readonly LabelParamDef[] | undefined): string[] {\n return (params ?? [])\n .filter((param): param is Exclude<LabelParamDef, string> => typeof param !== 'string' && param?.isCount === true)\n .map((param) => param.key)\n .filter((key) => typeof key === 'string' && key.length > 0);\n}\n\n/**\n * Merge each view label's declared count params into the unit's per-key metadata, keeping whatever the\n * specification projection already set for that key. `undefined` stays `undefined` when nothing applies.\n */\nexport function withDeclaredLabelCountParams(\n keys: readonly string[],\n keyMeta: Record<string, LabelKeyMeta> | undefined,\n /** Absent from a snapshot built before the field existed — read as \"no view declares a count\". */\n countParamsByKey: Readonly<Record<string, readonly string[]>> | undefined,\n): Record<string, LabelKeyMeta> | undefined {\n let merged = keyMeta;\n for (const key of keys) {\n const countParams = countParamsByKey?.[key];\n if (!countParams || countParams.length === 0) continue;\n merged = { ...(merged ?? {}), [key]: { ...(merged?.[key] ?? {}), countParams } };\n }\n return merged;\n}\n\nfunction slugify(input: string): string {\n return input.replace(/[^A-Za-z0-9_-]+/g, '_');\n}\n\nfunction countByCategory(units: LabellingUnit[]): Record<string, number> {\n const out: Record<string, number> = {};\n for (const u of units) out[u.category] = (out[u.category] ?? 0) + 1;\n return out;\n}\n\n"]}