@wildo-ai/dev-companion 1.1.2 → 1.1.4

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 (540) hide show
  1. package/dist/esm/.tsbuildinfo +1 -1
  2. package/dist/esm/__tests__/asset-noop.d.ts.map +1 -1
  3. package/dist/esm/__tests__/chdir-dogfood-app.setup.d.ts.map +1 -1
  4. package/dist/esm/__tests__/internal-test-view.d.ts.map +1 -1
  5. package/dist/esm/brand/models/logo-creative-brief.schemas.d.ts.map +1 -1
  6. package/dist/esm/brand/models/logo-generation.actors-system.definitions.d.ts.map +1 -1
  7. package/dist/esm/brand/models/logo-judge.actors-system.definitions.d.ts.map +1 -1
  8. package/dist/esm/brand/models/logo-judge.actors-system.definitions.js +9 -3
  9. package/dist/esm/brand/models/logo-judge.actors-system.definitions.js.map +1 -1
  10. package/dist/esm/brand/models/logo-judge.schemas.d.ts.map +1 -1
  11. package/dist/esm/brand/services/brand-accept.companion.service.d.ts +3 -24
  12. package/dist/esm/brand/services/brand-accept.companion.service.d.ts.map +1 -1
  13. package/dist/esm/brand/services/brand-accept.companion.service.js +10 -48
  14. package/dist/esm/brand/services/brand-accept.companion.service.js.map +1 -1
  15. package/dist/esm/brand/services/logo-deliberation.companion.service.d.ts.map +1 -1
  16. package/dist/esm/brand/services/logo-deliberation.companion.service.js +2 -8
  17. package/dist/esm/brand/services/logo-deliberation.companion.service.js.map +1 -1
  18. package/dist/esm/brand/services/logo-generation.companion.service.d.ts +6 -3
  19. package/dist/esm/brand/services/logo-generation.companion.service.d.ts.map +1 -1
  20. package/dist/esm/brand/services/logo-generation.companion.service.js +11 -12
  21. package/dist/esm/brand/services/logo-generation.companion.service.js.map +1 -1
  22. package/dist/esm/brand/utils/derived-brand-assets.d.ts +0 -1
  23. package/dist/esm/brand/utils/derived-brand-assets.d.ts.map +1 -1
  24. package/dist/esm/brand/utils/derived-brand-assets.js +1 -2
  25. package/dist/esm/brand/utils/derived-brand-assets.js.map +1 -1
  26. package/dist/esm/brand/utils/stage-brand-candidate.d.ts +7 -9
  27. package/dist/esm/brand/utils/stage-brand-candidate.d.ts.map +1 -1
  28. package/dist/esm/brand/utils/stage-brand-candidate.js +8 -11
  29. package/dist/esm/brand/utils/stage-brand-candidate.js.map +1 -1
  30. package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts +52 -2
  31. package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts.map +1 -1
  32. package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js +45 -0
  33. package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js.map +1 -1
  34. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.d.ts +45 -5
  35. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.d.ts.map +1 -1
  36. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js +180 -9
  37. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js.map +1 -1
  38. package/dist/esm/claude-cli/services/git-change-set.companion.service.d.ts +12 -22
  39. package/dist/esm/claude-cli/services/git-change-set.companion.service.d.ts.map +1 -1
  40. package/dist/esm/claude-cli/services/git-change-set.companion.service.js +151 -82
  41. package/dist/esm/claude-cli/services/git-change-set.companion.service.js.map +1 -1
  42. package/dist/esm/claude-cli/services/research-agent-dispatch.companion.service.d.ts +30 -4
  43. package/dist/esm/claude-cli/services/research-agent-dispatch.companion.service.d.ts.map +1 -1
  44. package/dist/esm/claude-cli/services/research-agent-dispatch.companion.service.js +30 -4
  45. package/dist/esm/claude-cli/services/research-agent-dispatch.companion.service.js.map +1 -1
  46. package/dist/esm/claude-cli/services/research-evidence-store.companion.d.ts +1 -1
  47. package/dist/esm/claude-cli/services/research-evidence-store.companion.d.ts.map +1 -1
  48. package/dist/esm/claude-cli/services/research-evidence-store.companion.js +1 -1
  49. package/dist/esm/claude-cli/services/research-evidence-store.companion.js.map +1 -1
  50. package/dist/esm/code-compliance-check/check-label-placeholder-contract.companion.d.ts.map +1 -1
  51. package/dist/esm/code-compliance-check/check-raw-feature-id-literals.companion.d.ts.map +1 -1
  52. package/dist/esm/companion-api/companion-api.schemas.d.ts +57 -57
  53. package/dist/esm/companion-api/companion-api.schemas.d.ts.map +1 -1
  54. package/dist/esm/companion-api/controllers/companion-i18n-api-contract.utils.d.ts.map +1 -1
  55. package/dist/esm/companion-api/controllers/companion-token-floor.policy.d.ts +90 -0
  56. package/dist/esm/companion-api/controllers/companion-token-floor.policy.d.ts.map +1 -0
  57. package/dist/esm/companion-api/controllers/companion-token-floor.policy.js +98 -0
  58. package/dist/esm/companion-api/controllers/companion-token-floor.policy.js.map +1 -0
  59. package/dist/esm/companion-api/controllers/companion.controller.d.ts +32 -5
  60. package/dist/esm/companion-api/controllers/companion.controller.d.ts.map +1 -1
  61. package/dist/esm/companion-api/controllers/companion.controller.js +126 -41
  62. package/dist/esm/companion-api/controllers/companion.controller.js.map +1 -1
  63. package/dist/esm/core/auth/companion-auth-floor.companion.service.d.ts +8 -1
  64. package/dist/esm/core/auth/companion-auth-floor.companion.service.d.ts.map +1 -1
  65. package/dist/esm/core/auth/companion-auth-floor.companion.service.js +8 -1
  66. package/dist/esm/core/auth/companion-auth-floor.companion.service.js.map +1 -1
  67. package/dist/esm/core/catalogs/catalog-context.factory.d.ts.map +1 -1
  68. package/dist/esm/core/catalogs/catalog-context.factory.models.d.ts.map +1 -1
  69. package/dist/esm/core/catalogs/schema-org/aggregate-offer-catalog-context.factory.d.ts.map +1 -1
  70. package/dist/esm/core/catalogs/schema-org/aggregate-rating-catalog-context.factory.d.ts.map +1 -1
  71. package/dist/esm/core/catalogs/schema-org/article-catalog-context.factory.d.ts.map +1 -1
  72. package/dist/esm/core/catalogs/schema-org/blog-posting-catalog-context.factory.d.ts.map +1 -1
  73. package/dist/esm/core/catalogs/schema-org/breadcrumb-list-catalog-context.factory.d.ts.map +1 -1
  74. package/dist/esm/core/catalogs/schema-org/faq-page-catalog-context.factory.d.ts.map +1 -1
  75. package/dist/esm/core/catalogs/schema-org/offer-catalog-context.factory.d.ts.map +1 -1
  76. package/dist/esm/core/catalogs/schema-org/organization-catalog-context.factory.d.ts.map +1 -1
  77. package/dist/esm/core/catalogs/schema-org/product-catalog-context.factory.d.ts.map +1 -1
  78. package/dist/esm/core/catalogs/schema-org/review-catalog-context.factory.d.ts.map +1 -1
  79. package/dist/esm/core/catalogs/schema-org/schema-org-catalog-boundary.shared.d.ts +34 -0
  80. package/dist/esm/core/catalogs/schema-org/schema-org-catalog-boundary.shared.d.ts.map +1 -0
  81. package/dist/esm/core/catalogs/schema-org/schema-org-catalog-boundary.shared.js +65 -0
  82. package/dist/esm/core/catalogs/schema-org/schema-org-catalog-boundary.shared.js.map +1 -0
  83. package/dist/esm/core/catalogs/schema-org/schema-org-catalog-context.shared.d.ts +11 -1
  84. package/dist/esm/core/catalogs/schema-org/schema-org-catalog-context.shared.d.ts.map +1 -1
  85. package/dist/esm/core/catalogs/schema-org/schema-org-catalog-context.shared.js.map +1 -1
  86. package/dist/esm/core/catalogs/schema-org/software-application-catalog-context.factory.d.ts.map +1 -1
  87. package/dist/esm/core/catalogs/schema-org/website-catalog-context.factory.d.ts.map +1 -1
  88. package/dist/esm/core/catalogs/structured-data-catalog-audit.service.d.ts.map +1 -1
  89. package/dist/esm/core/catalogs/structured-data-catalog-audit.service.js +10 -2
  90. package/dist/esm/core/catalogs/structured-data-catalog-audit.service.js.map +1 -1
  91. package/dist/esm/core/config/primary-language.companion.utils.d.ts.map +1 -1
  92. package/dist/esm/core/context/companion-context.d.ts.map +1 -1
  93. package/dist/esm/core/context/companion-package-loaders.companion.d.ts.map +1 -1
  94. package/dist/esm/core/inject/models/container.d.ts.map +1 -1
  95. package/dist/esm/core/inject/models/container.js +0 -7
  96. package/dist/esm/core/inject/models/container.js.map +1 -1
  97. package/dist/esm/core/inject/models/service-types.d.ts +0 -1
  98. package/dist/esm/core/inject/models/service-types.d.ts.map +1 -1
  99. package/dist/esm/core/inject/models/service-types.js +0 -1
  100. package/dist/esm/core/inject/models/service-types.js.map +1 -1
  101. package/dist/esm/core/introspection/behaviors/companion-introspection-behavior-definitions.d.ts.map +1 -1
  102. package/dist/esm/core/introspection/models/companion-introspection.models.d.ts.map +1 -1
  103. package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.d.ts.map +1 -1
  104. package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.js +8 -4
  105. package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.js.map +1 -1
  106. package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.d.ts.map +1 -1
  107. package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.js.map +1 -1
  108. package/dist/esm/core/introspection/resources/introspection-resource-notifier.companion.service.d.ts.map +1 -1
  109. package/dist/esm/core/introspection/resources/introspection-resource-source.companion.service.d.ts.map +1 -1
  110. package/dist/esm/core/introspection/services/companion-introspection-behavior-registry.companion.service.d.ts.map +1 -1
  111. package/dist/esm/core/introspection/services/companion-introspection.companion.service.d.ts.map +1 -1
  112. package/dist/esm/core/introspection/services/companion-introspection.companion.service.js +42 -1
  113. package/dist/esm/core/introspection/services/companion-introspection.companion.service.js.map +1 -1
  114. package/dist/esm/core/introspection/services/introspection-derivation-state.companion.service.d.ts.map +1 -1
  115. package/dist/esm/core/introspection/services/introspection-source-state.companion.service.d.ts.map +1 -1
  116. package/dist/esm/core/introspection/services/introspection-source-watcher.companion.service.d.ts.map +1 -1
  117. package/dist/esm/core/introspection/services/translation-placement.companion.service.d.ts.map +1 -1
  118. package/dist/esm/core/introspection/subprocess/application-domain-model.behavior.d.ts.map +1 -1
  119. package/dist/esm/core/introspection/subprocess/application-domain-model.behavior.js.map +1 -1
  120. package/dist/esm/core/introspection/subprocess/assertions.behavior.d.ts.map +1 -1
  121. package/dist/esm/core/introspection/subprocess/asset-noop-hooks.d.ts.map +1 -1
  122. package/dist/esm/core/introspection/subprocess/asset-noop-register.d.ts.map +1 -1
  123. package/dist/esm/core/introspection/subprocess/brand-prompt-renderer.d.ts.map +1 -1
  124. package/dist/esm/core/introspection/subprocess/chart-registration-refs.behavior.d.ts.map +1 -1
  125. package/dist/esm/core/introspection/subprocess/companion-introspection-behavior-handlers.d.ts.map +1 -1
  126. package/dist/esm/core/introspection/subprocess/companion-introspection-behavior-handlers.js +3 -2
  127. package/dist/esm/core/introspection/subprocess/companion-introspection-behavior-handlers.js.map +1 -1
  128. package/dist/esm/core/introspection/subprocess/companion-introspection-child.d.ts.map +1 -1
  129. package/dist/esm/core/introspection/subprocess/companion-introspection-module-exports.utils.d.ts.map +1 -1
  130. package/dist/esm/core/introspection/subprocess/compliance-primary-facts.behavior.d.ts +14 -5
  131. package/dist/esm/core/introspection/subprocess/compliance-primary-facts.behavior.d.ts.map +1 -1
  132. package/dist/esm/core/introspection/subprocess/compliance-primary-facts.behavior.js +14 -5
  133. package/dist/esm/core/introspection/subprocess/compliance-primary-facts.behavior.js.map +1 -1
  134. package/dist/esm/core/introspection/subprocess/definition-specifications.behavior.d.ts.map +1 -1
  135. package/dist/esm/core/introspection/subprocess/expert-persona-brief.renderer.d.ts.map +1 -1
  136. package/dist/esm/core/introspection/subprocess/family-aspects.behavior.d.ts.map +1 -1
  137. package/dist/esm/core/introspection/subprocess/family-aspects.behavior.js.map +1 -1
  138. package/dist/esm/core/introspection/subprocess/frontend-labels-needed-info.behavior.d.ts.map +1 -1
  139. package/dist/esm/core/introspection/subprocess/market-context-block.builder.d.ts.map +1 -1
  140. package/dist/esm/core/introspection/subprocess/market-prompt-renderer.d.ts.map +1 -1
  141. package/dist/esm/core/introspection/subprocess/openapi-generation-input.behavior.d.ts +38 -1
  142. package/dist/esm/core/introspection/subprocess/openapi-generation-input.behavior.d.ts.map +1 -1
  143. package/dist/esm/core/introspection/subprocess/openapi-generation-input.behavior.js +143 -19
  144. package/dist/esm/core/introspection/subprocess/openapi-generation-input.behavior.js.map +1 -1
  145. package/dist/esm/core/introspection/subprocess/specification-artifacts.behavior.d.ts.map +1 -1
  146. package/dist/esm/core/lock/wildo-saas-lock.companion.service.d.ts +23 -0
  147. package/dist/esm/core/lock/wildo-saas-lock.companion.service.d.ts.map +1 -1
  148. package/dist/esm/core/lock/wildo-saas-lock.companion.service.js +23 -0
  149. package/dist/esm/core/lock/wildo-saas-lock.companion.service.js.map +1 -1
  150. package/dist/esm/core/lock/wildo-saas-lock.models.d.ts.map +1 -1
  151. package/dist/esm/core/lock/wildo-saas-lock.schemas.d.ts +4 -4
  152. package/dist/esm/core/lock/wildo-saas-lock.schemas.d.ts.map +1 -1
  153. package/dist/esm/core/runtime/companion-startup-assembly.d.ts.map +1 -1
  154. package/dist/esm/core/runtime/companion-startup-assembly.js.map +1 -1
  155. package/dist/esm/core/runtime/dev-compile-quiet.companion.d.ts.map +1 -1
  156. package/dist/esm/core/runtime/models/companion-runtime.models.d.ts.map +1 -1
  157. package/dist/esm/core/runtime/services/start-companion-application.service.d.ts +16 -13
  158. package/dist/esm/core/runtime/services/start-companion-application.service.d.ts.map +1 -1
  159. package/dist/esm/core/runtime/services/start-companion-application.service.js +70 -45
  160. package/dist/esm/core/runtime/services/start-companion-application.service.js.map +1 -1
  161. package/dist/esm/core/runtime/utils/companion-local-signing-key.companion.d.ts.map +1 -1
  162. package/dist/esm/core/runtime/utils/companion-platform-config.companion.d.ts.map +1 -1
  163. package/dist/esm/core/runtime/utils/companion-platform-config.companion.js +9 -2
  164. package/dist/esm/core/runtime/utils/companion-platform-config.companion.js.map +1 -1
  165. package/dist/esm/core/runtime/utils/companion-workbench-topology.d.ts.map +1 -1
  166. package/dist/esm/core/runtime/utils/platform-core-domain-modules.companion.d.ts.map +1 -1
  167. package/dist/esm/core/specifications/chart-view-specification-context.factory.d.ts.map +1 -1
  168. package/dist/esm/core/specifications/composite-view-specification-context.factory.d.ts.map +1 -1
  169. package/dist/esm/core/specifications/cross-registry-rendering.shared.d.ts.map +1 -1
  170. package/dist/esm/core/specifications/execution-view-specification-context.factory.d.ts.map +1 -1
  171. package/dist/esm/core/specifications/feature-specification-context.factory.d.ts.map +1 -1
  172. package/dist/esm/core/specifications/flows-actors-view-specification-context.factory.d.ts.map +1 -1
  173. package/dist/esm/core/specifications/frontend-component-specification-context.factory.d.ts.map +1 -1
  174. package/dist/esm/core/specifications/full-custom-view-specification-context.factory.d.ts.map +1 -1
  175. package/dist/esm/core/specifications/guidance-flow-specification-context.factory.d.ts.map +1 -1
  176. package/dist/esm/core/specifications/milestone-specification-context.factory.d.ts.map +1 -1
  177. package/dist/esm/core/specifications/non-composite-view-specification-context.shared.d.ts.map +1 -1
  178. package/dist/esm/core/specifications/onboarding-element-rendering.shared.d.ts.map +1 -1
  179. package/dist/esm/core/specifications/onboarding-view-specification-context.factory.d.ts.map +1 -1
  180. package/dist/esm/core/specifications/product-specification-context.factory.d.ts.map +1 -1
  181. package/dist/esm/core/specifications/resource-specification-context.factory.d.ts.map +1 -1
  182. package/dist/esm/core/specifications/role-specification-context.factory.d.ts.map +1 -1
  183. package/dist/esm/core/specifications/specification-context-factory.d.ts.map +1 -1
  184. package/dist/esm/core/specifications/specification-context-factory.models.d.ts.map +1 -1
  185. package/dist/esm/core/specifications/specification-context-factory.shared.d.ts.map +1 -1
  186. package/dist/esm/core/specifications/system-email-template-specification-context.factory.d.ts.map +1 -1
  187. package/dist/esm/core/specifications/templates/composite-view/composite-view-all-information.template.d.ts.map +1 -1
  188. package/dist/esm/core/specifications/templates/composite-view/composite-view-custom-implementation-context.template.d.ts.map +1 -1
  189. package/dist/esm/core/specifications/templates/composite-view/composite-view-development-usage-context.template.d.ts.map +1 -1
  190. package/dist/esm/core/specifications/templates/composite-view/composite-view-translation-context.template.d.ts.map +1 -1
  191. package/dist/esm/core/specifications/templates/feature/feature-all-information.template.d.ts.map +1 -1
  192. package/dist/esm/core/specifications/templates/feature/feature-custom-implementation-context.template.d.ts.map +1 -1
  193. package/dist/esm/core/specifications/templates/feature/feature-development-usage-context.template.d.ts.map +1 -1
  194. package/dist/esm/core/specifications/templates/feature/feature-translation-context.template.d.ts.map +1 -1
  195. package/dist/esm/core/specifications/templates/frontend-component/frontend-component-all-information.template.d.ts.map +1 -1
  196. package/dist/esm/core/specifications/templates/frontend-component/frontend-component-custom-implementation-context.template.d.ts.map +1 -1
  197. package/dist/esm/core/specifications/templates/frontend-component/frontend-component-development-usage-context.template.d.ts.map +1 -1
  198. package/dist/esm/core/specifications/templates/frontend-component/frontend-component-translation-context.template.d.ts.map +1 -1
  199. package/dist/esm/core/specifications/templates/guidance-flow-specification/guidance-flow-all-information.template.d.ts.map +1 -1
  200. package/dist/esm/core/specifications/templates/guidance-flow-specification/guidance-flow-custom-implementation-context.template.d.ts.map +1 -1
  201. package/dist/esm/core/specifications/templates/guidance-flow-specification/guidance-flow-development-usage-context.template.d.ts.map +1 -1
  202. package/dist/esm/core/specifications/templates/guidance-flow-specification/guidance-flow-translation-context.template.d.ts.map +1 -1
  203. package/dist/esm/core/specifications/templates/milestone/milestone-all-information.template.d.ts.map +1 -1
  204. package/dist/esm/core/specifications/templates/milestone/milestone-custom-implementation-context.template.d.ts.map +1 -1
  205. package/dist/esm/core/specifications/templates/milestone/milestone-development-usage-context.template.d.ts.map +1 -1
  206. package/dist/esm/core/specifications/templates/milestone/milestone-translation-context.template.d.ts.map +1 -1
  207. package/dist/esm/core/specifications/templates/non-composite-view/non-composite-view-all-information.template.d.ts.map +1 -1
  208. package/dist/esm/core/specifications/templates/non-composite-view/non-composite-view-custom-implementation-context.template.d.ts.map +1 -1
  209. package/dist/esm/core/specifications/templates/non-composite-view/non-composite-view-development-usage-context.template.d.ts.map +1 -1
  210. package/dist/esm/core/specifications/templates/non-composite-view/non-composite-view-translation-context.template.d.ts.map +1 -1
  211. package/dist/esm/core/specifications/templates/onboarding-view-specification/onboarding-view-all-information.template.d.ts.map +1 -1
  212. package/dist/esm/core/specifications/templates/onboarding-view-specification/onboarding-view-custom-implementation-context.template.d.ts.map +1 -1
  213. package/dist/esm/core/specifications/templates/onboarding-view-specification/onboarding-view-development-usage-context.template.d.ts.map +1 -1
  214. package/dist/esm/core/specifications/templates/onboarding-view-specification/onboarding-view-translation-context.template.d.ts.map +1 -1
  215. package/dist/esm/core/specifications/templates/product/product-all-information.template.d.ts.map +1 -1
  216. package/dist/esm/core/specifications/templates/product/product-custom-implementation-context.template.d.ts.map +1 -1
  217. package/dist/esm/core/specifications/templates/product/product-development-usage-context.template.d.ts.map +1 -1
  218. package/dist/esm/core/specifications/templates/product/product-translation-context.template.d.ts.map +1 -1
  219. package/dist/esm/core/specifications/templates/resource/resource-all-information.template.d.ts.map +1 -1
  220. package/dist/esm/core/specifications/templates/resource/resource-custom-implementation-context.template.d.ts.map +1 -1
  221. package/dist/esm/core/specifications/templates/resource/resource-development-usage-context.template.d.ts.map +1 -1
  222. package/dist/esm/core/specifications/templates/resource/resource-translation-context.template.d.ts.map +1 -1
  223. package/dist/esm/core/specifications/templates/role/role-all-information.template.d.ts.map +1 -1
  224. package/dist/esm/core/specifications/templates/role/role-custom-implementation-context.template.d.ts.map +1 -1
  225. package/dist/esm/core/specifications/templates/role/role-development-usage-context.template.d.ts.map +1 -1
  226. package/dist/esm/core/specifications/templates/role/role-translation-context.template.d.ts.map +1 -1
  227. package/dist/esm/core/specifications/templates/system-email-template/system-email-template-all-information.template.d.ts.map +1 -1
  228. package/dist/esm/core/specifications/templates/system-email-template/system-email-template-custom-implementation-context.template.d.ts.map +1 -1
  229. package/dist/esm/core/specifications/templates/system-email-template/system-email-template-development-usage-context.template.d.ts.map +1 -1
  230. package/dist/esm/core/specifications/templates/system-email-template/system-email-template-translation-context.template.d.ts.map +1 -1
  231. package/dist/esm/core/specifications/validate-resource-field-completeness.d.ts.map +1 -1
  232. package/dist/esm/core/traceability/companion-agent-call-trace-sink.companion.service.d.ts.map +1 -1
  233. package/dist/esm/core/traceability/companion-agent-call-trace-sink.companion.service.js +4 -4
  234. package/dist/esm/core/traceability/companion-agent-call-trace-sink.companion.service.js.map +1 -1
  235. package/dist/esm/core/traceability/companion-traceability.models.d.ts.map +1 -1
  236. package/dist/esm/core/traceability/companion-traceability.service.d.ts.map +1 -1
  237. package/dist/esm/core/utils/atomic-write.utils.d.ts.map +1 -1
  238. package/dist/esm/deliberations/models/deliberation-agents.actors-system.definitions.d.ts.map +1 -1
  239. package/dist/esm/deliberations/models/deliberation-agents.actors-system.definitions.js +13 -3
  240. package/dist/esm/deliberations/models/deliberation-agents.actors-system.definitions.js.map +1 -1
  241. package/dist/esm/deliberations/services/deliberation.companion.service.d.ts.map +1 -1
  242. package/dist/esm/deliberations/services/deliberation.companion.service.js +0 -5
  243. package/dist/esm/deliberations/services/deliberation.companion.service.js.map +1 -1
  244. package/dist/esm/deliberations/services/structured-deliberation.companion.service.d.ts.map +1 -1
  245. package/dist/esm/deliberations/services/structured-deliberation.companion.service.js +0 -2
  246. package/dist/esm/deliberations/services/structured-deliberation.companion.service.js.map +1 -1
  247. package/dist/esm/deliberations/utils/load-committed-expert-agents.d.ts.map +1 -1
  248. package/dist/esm/email/models/email-template.actors-system.definitions.d.ts.map +1 -1
  249. package/dist/esm/email/models/email-template.actors-system.definitions.js +4 -2
  250. package/dist/esm/email/models/email-template.actors-system.definitions.js.map +1 -1
  251. package/dist/esm/email/services/email-spec-context-loader.companion.service.d.ts +1 -1
  252. package/dist/esm/email/services/email-spec-context-loader.companion.service.d.ts.map +1 -1
  253. package/dist/esm/email/services/email-spec-context-loader.companion.service.js +1 -1
  254. package/dist/esm/email/services/email-spec-context-loader.companion.service.js.map +1 -1
  255. package/dist/esm/email/services/email-template.companion.service.d.ts.map +1 -1
  256. package/dist/esm/email/services/email-template.companion.service.js +23 -1
  257. package/dist/esm/email/services/email-template.companion.service.js.map +1 -1
  258. package/dist/esm/email/utils/email-labels-file-source.utils.d.ts.map +1 -1
  259. package/dist/esm/email/utils/email-template-fs-discovery.utils.d.ts.map +1 -1
  260. package/dist/esm/executions/services/companion-executions.companion.service.d.ts.map +1 -1
  261. package/dist/esm/executions/services/companion-executions.companion.service.js +15 -2
  262. package/dist/esm/executions/services/companion-executions.companion.service.js.map +1 -1
  263. package/dist/esm/expert-personas/models/expert-persona-critique.actors-system.definitions.d.ts.map +1 -1
  264. package/dist/esm/expert-personas/models/expert-persona-critique.actors-system.definitions.js +7 -3
  265. package/dist/esm/expert-personas/models/expert-persona-critique.actors-system.definitions.js.map +1 -1
  266. package/dist/esm/expert-personas/models/expert-persona-derivation.actors-system.definitions.d.ts.map +1 -1
  267. package/dist/esm/expert-personas/models/expert-persona-derivation.actors-system.definitions.js +11 -5
  268. package/dist/esm/expert-personas/models/expert-persona-derivation.actors-system.definitions.js.map +1 -1
  269. package/dist/esm/expert-personas/models/expert-persona-derivation.schemas.d.ts.map +1 -1
  270. package/dist/esm/expert-personas/services/expert-persona.companion.service.d.ts +9 -24
  271. package/dist/esm/expert-personas/services/expert-persona.companion.service.d.ts.map +1 -1
  272. package/dist/esm/expert-personas/services/expert-persona.companion.service.js +11 -60
  273. package/dist/esm/expert-personas/services/expert-persona.companion.service.js.map +1 -1
  274. package/dist/esm/i18n/components/APPLICATION_LEVEL_ACTIVITY_BAR.en.d.ts.map +1 -1
  275. package/dist/esm/i18n/components/APPLICATION_LEVEL_COMMAND_MENU.en.d.ts.map +1 -1
  276. package/dist/esm/i18n/components/APPLICATION_LEVEL_CONTROL_PANEL.en.d.ts.map +1 -1
  277. package/dist/esm/i18n/components/APPLICATION_LEVEL_MENUBAR.en.d.ts.map +1 -1
  278. package/dist/esm/i18n/components/APPLICATION_LEVEL_NAVIGATION_BACK.en.d.ts.map +1 -1
  279. package/dist/esm/i18n/components/APPLICATION_LEVEL_NOTIFICATION_CENTER.en.d.ts.map +1 -1
  280. package/dist/esm/i18n/components/APPLICATION_LEVEL_QUICK_ACTION_BUTTON.en.d.ts.map +1 -1
  281. package/dist/esm/i18n/components/APPLICATION_LEVEL_QUICK_SWITCHER.en.d.ts.map +1 -1
  282. package/dist/esm/i18n/components/APPLICATION_LEVEL_SIDEBAR.en.d.ts.map +1 -1
  283. package/dist/esm/i18n/components/APPLICATION_LEVEL_STATUS_BAR.en.d.ts.map +1 -1
  284. package/dist/esm/i18n/components/APPLICATION_LEVEL_TOOLBAR.en.d.ts.map +1 -1
  285. package/dist/esm/i18n/components/APPLICATION_LEVEL_USER_DROPDOWN.en.d.ts.map +1 -1
  286. package/dist/esm/i18n/components/APPLICATION_LEVEL_UTILITY_PANEL.en.d.ts.map +1 -1
  287. package/dist/esm/i18n/components/APP_LAYOUTS_APPEARANCE_SETTINGS.en.d.ts.map +1 -1
  288. package/dist/esm/i18n/components/APP_LAYOUTS_BILLING_SETTINGS.en.d.ts.map +1 -1
  289. package/dist/esm/i18n/components/APP_LAYOUTS_ERROR_BOUNDARY.en.d.ts.map +1 -1
  290. package/dist/esm/i18n/components/APP_LAYOUTS_HOME.en.d.ts.map +1 -1
  291. package/dist/esm/i18n/components/APP_LAYOUTS_INVITATIONS_SETTINGS.en.d.ts.map +1 -1
  292. package/dist/esm/i18n/components/APP_LAYOUTS_MAIN_CONTAINER.en.d.ts.map +1 -1
  293. package/dist/esm/i18n/components/APP_LAYOUTS_ROUTER_ERROR_BOUNDARY.en.d.ts.map +1 -1
  294. package/dist/esm/i18n/components/APP_LAYOUTS_SECURITY_SETTINGS.en.d.ts.map +1 -1
  295. package/dist/esm/i18n/components/APP_LAYOUTS_SETTINGS_HUB.en.d.ts.map +1 -1
  296. package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART.en.d.ts.map +1 -1
  297. package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_WIDGET.en.d.ts.map +1 -1
  298. package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_EXECUTION.en.d.ts.map +1 -1
  299. package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_FLOWS_ACTORS.en.d.ts.map +1 -1
  300. package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_NOT_FOUND.en.d.ts.map +1 -1
  301. package/dist/esm/i18n/components/LOW_LEVEL_ACTION_BAR.en.d.ts.map +1 -1
  302. package/dist/esm/i18n/components/LOW_LEVEL_AI_ACTOR.en.d.ts.map +1 -1
  303. package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.en.d.ts.map +1 -1
  304. package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.en.d.ts.map +1 -1
  305. package/dist/esm/i18n/components/LOW_LEVEL_AI_ARTIFACT.en.d.ts.map +1 -1
  306. package/dist/esm/i18n/components/LOW_LEVEL_AI_ARTIFACT_BROWSER.en.d.ts.map +1 -1
  307. package/dist/esm/i18n/components/LOW_LEVEL_AI_CHAIN_OF_THOUGHT.en.d.ts.map +1 -1
  308. package/dist/esm/i18n/components/LOW_LEVEL_AI_CODE_BLOCK.en.d.ts.map +1 -1
  309. package/dist/esm/i18n/components/LOW_LEVEL_AI_CONFIRMATION.en.d.ts.map +1 -1
  310. package/dist/esm/i18n/components/LOW_LEVEL_AI_CONTEXT.en.d.ts.map +1 -1
  311. package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION.en.d.ts.map +1 -1
  312. package/dist/esm/i18n/components/LOW_LEVEL_AI_DECISION.en.d.ts.map +1 -1
  313. package/dist/esm/i18n/components/LOW_LEVEL_AI_EXECUTION_PLAN.en.d.ts.map +1 -1
  314. package/dist/esm/i18n/components/LOW_LEVEL_AI_EXECUTION_STREAM.en.d.ts.map +1 -1
  315. package/dist/esm/i18n/components/LOW_LEVEL_AI_FLOW_EXECUTION.en.d.ts.map +1 -1
  316. package/dist/esm/i18n/components/LOW_LEVEL_AI_FLOW_NODE.en.d.ts.map +1 -1
  317. package/dist/esm/i18n/components/LOW_LEVEL_AI_INLINE_CITATION.en.d.ts.map +1 -1
  318. package/dist/esm/i18n/components/LOW_LEVEL_AI_MESSAGE.en.d.ts.map +1 -1
  319. package/dist/esm/i18n/components/LOW_LEVEL_AI_MODEL_SELECTOR.en.d.ts.map +1 -1
  320. package/dist/esm/i18n/components/LOW_LEVEL_AI_OPEN_IN_CHAT.en.d.ts.map +1 -1
  321. package/dist/esm/i18n/components/LOW_LEVEL_AI_PLAN.en.d.ts.map +1 -1
  322. package/dist/esm/i18n/components/LOW_LEVEL_AI_PROMPT_INPUT.en.d.ts.map +1 -1
  323. package/dist/esm/i18n/components/LOW_LEVEL_AI_SYSTEM_CATALOG.en.d.ts.map +1 -1
  324. package/dist/esm/i18n/components/LOW_LEVEL_AI_TASK_DETAIL.en.d.ts.map +1 -1
  325. package/dist/esm/i18n/components/LOW_LEVEL_AI_TASK_MEMORY.en.d.ts.map +1 -1
  326. package/dist/esm/i18n/components/LOW_LEVEL_AI_WEB_PREVIEW.en.d.ts.map +1 -1
  327. package/dist/esm/i18n/components/LOW_LEVEL_BILLING_INVOICE_HISTORY.en.d.ts.map +1 -1
  328. package/dist/esm/i18n/components/LOW_LEVEL_BILLING_PORTAL_LINK.en.d.ts.map +1 -1
  329. package/dist/esm/i18n/components/LOW_LEVEL_BILLING_PRICING_TABLE.en.d.ts.map +1 -1
  330. package/dist/esm/i18n/components/LOW_LEVEL_BILLING_SUBSCRIPTION_STATUS.en.d.ts.map +1 -1
  331. package/dist/esm/i18n/components/LOW_LEVEL_BILLING_USAGE_DASHBOARD.en.d.ts.map +1 -1
  332. package/dist/esm/i18n/components/LOW_LEVEL_BREADCRUMB.en.d.ts.map +1 -1
  333. package/dist/esm/i18n/components/LOW_LEVEL_BUTTON.en.d.ts.map +1 -1
  334. package/dist/esm/i18n/components/LOW_LEVEL_CAROUSEL.en.d.ts.map +1 -1
  335. package/dist/esm/i18n/components/LOW_LEVEL_CELEBRATION_OVERLAY.en.d.ts.map +1 -1
  336. package/dist/esm/i18n/components/LOW_LEVEL_COLOR_INPUT.en.d.ts.map +1 -1
  337. package/dist/esm/i18n/components/LOW_LEVEL_COMMAND.en.d.ts.map +1 -1
  338. package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.en.d.ts.map +1 -1
  339. package/dist/esm/i18n/components/LOW_LEVEL_DIALOG.en.d.ts.map +1 -1
  340. package/dist/esm/i18n/components/LOW_LEVEL_DISPLAY_FIELD_BIGDECIMAL.en.d.ts.map +1 -1
  341. package/dist/esm/i18n/components/LOW_LEVEL_DISPLAY_FIELD_BOOLEAN.en.d.ts.map +1 -1
  342. package/dist/esm/i18n/components/LOW_LEVEL_DISPLAY_FIELD_CODE.en.d.ts.map +1 -1
  343. package/dist/esm/i18n/components/LOW_LEVEL_DISPLAY_FIELD_DURATION.en.d.ts.map +1 -1
  344. package/dist/esm/i18n/components/LOW_LEVEL_DISPLAY_FIELD_FILE.en.d.ts.map +1 -1
  345. package/dist/esm/i18n/components/LOW_LEVEL_DISPLAY_FIELD_FILE_AUDIO.en.d.ts.map +1 -1
  346. package/dist/esm/i18n/components/LOW_LEVEL_DISPLAY_FIELD_FILE_DOCUMENT.en.d.ts.map +1 -1
  347. package/dist/esm/i18n/components/LOW_LEVEL_DISPLAY_FIELD_FILE_GALLERY.en.d.ts.map +1 -1
  348. package/dist/esm/i18n/components/LOW_LEVEL_DISPLAY_FIELD_FILE_IMAGE.en.d.ts.map +1 -1
  349. package/dist/esm/i18n/components/LOW_LEVEL_DISPLAY_FIELD_FILE_VIDEO.en.d.ts.map +1 -1
  350. package/dist/esm/i18n/components/LOW_LEVEL_DISPLAY_FIELD_MONEY.en.d.ts.map +1 -1
  351. package/dist/esm/i18n/components/LOW_LEVEL_DISPLAY_FIELD_PHONE.en.d.ts.map +1 -1
  352. package/dist/esm/i18n/components/LOW_LEVEL_DISPLAY_FIELD_RANGE_BIGDECIMAL.en.d.ts.map +1 -1
  353. package/dist/esm/i18n/components/LOW_LEVEL_DISPLAY_FIELD_RANGE_MONEY.en.d.ts.map +1 -1
  354. package/dist/esm/i18n/components/LOW_LEVEL_DISPLAY_FIELD_RANGE_NUMBER.en.d.ts.map +1 -1
  355. package/dist/esm/i18n/components/LOW_LEVEL_DRAWER.en.d.ts.map +1 -1
  356. package/dist/esm/i18n/components/LOW_LEVEL_ERROR_DISPLAY.en.d.ts.map +1 -1
  357. package/dist/esm/i18n/components/LOW_LEVEL_FEATURE_LOCK_BADGE.en.d.ts.map +1 -1
  358. package/dist/esm/i18n/components/LOW_LEVEL_FEATURE_UNAVAILABLE_PROMPT.en.d.ts.map +1 -1
  359. package/dist/esm/i18n/components/LOW_LEVEL_FILE_UPLOAD.en.d.ts.map +1 -1
  360. package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD.en.d.ts.map +1 -1
  361. package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_BOOLEAN.en.d.ts.map +1 -1
  362. package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_CODE.en.d.ts.map +1 -1
  363. package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_FILE.en.d.ts.map +1 -1
  364. package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_PHONE.en.d.ts.map +1 -1
  365. package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.en.d.ts.map +1 -1
  366. package/dist/esm/i18n/components/LOW_LEVEL_FORM_MESSAGE.en.d.ts.map +1 -1
  367. package/dist/esm/i18n/components/LOW_LEVEL_IMAGE_CROP.en.d.ts.map +1 -1
  368. package/dist/esm/i18n/components/LOW_LEVEL_LOADING_OVERLAY.en.d.ts.map +1 -1
  369. package/dist/esm/i18n/components/LOW_LEVEL_LOADING_SPINNER.en.d.ts.map +1 -1
  370. package/dist/esm/i18n/components/LOW_LEVEL_OPERATIONS_CONFIRM_CRITICAL.en.d.ts.map +1 -1
  371. package/dist/esm/i18n/components/LOW_LEVEL_OVERLAY_CONTAINER.en.d.ts.map +1 -1
  372. package/dist/esm/i18n/components/LOW_LEVEL_PAGINATION.en.d.ts.map +1 -1
  373. package/dist/esm/i18n/components/LOW_LEVEL_SELECT_MULTIPLE.en.d.ts.map +1 -1
  374. package/dist/esm/i18n/components/LOW_LEVEL_SHEET.en.d.ts.map +1 -1
  375. package/dist/esm/i18n/components/LOW_LEVEL_SIDEBAR.en.d.ts.map +1 -1
  376. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_AUTH_CALLBACK.en.d.ts.map +1 -1
  377. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_ENROLLMENT_REQUIRED.en.d.ts.map +1 -1
  378. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_FILE_UPLOAD_GRANT.en.d.ts +39 -0
  379. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_FILE_UPLOAD_GRANT.en.d.ts.map +1 -0
  380. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_FILE_UPLOAD_GRANT.en.js +39 -0
  381. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_FILE_UPLOAD_GRANT.en.js.map +1 -0
  382. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MAGIC_LINK_VERIFY.en.d.ts.map +1 -1
  383. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.en.d.ts.map +1 -1
  384. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_OAUTH_CONSENT.en.d.ts.map +1 -1
  385. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_OAUTH_LOGGED_OUT.en.d.ts.map +1 -1
  386. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_OAUTH_LOGOUT_CONFIRM.en.d.ts.map +1 -1
  387. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_ONE_OFF_SESSION.en.d.ts.map +1 -1
  388. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.en.d.ts.map +1 -1
  389. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_AUTH.en.d.ts.map +1 -1
  390. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_CONFIRM_EMAIL.en.d.ts.map +1 -1
  391. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_INVITATION.en.d.ts.map +1 -1
  392. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_PASSWORD_LOST.en.d.ts.map +1 -1
  393. package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_REGISTER.en.d.ts.map +1 -1
  394. package/dist/esm/i18n/components/RESOURCES_FIELDS_RESOURCE_REFERENCE.en.d.ts.map +1 -1
  395. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_ACTION.en.d.ts.map +1 -1
  396. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_CONTAINER_NESTED.en.d.ts.map +1 -1
  397. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_CREATE.en.d.ts.map +1 -1
  398. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_DANGER_ZONE.en.d.ts.map +1 -1
  399. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.en.d.ts.map +1 -1
  400. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_HEADER.en.d.ts.map +1 -1
  401. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.en.d.ts.map +1 -1
  402. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_OPERATIONS_BULK.en.d.ts.map +1 -1
  403. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_OPERATIONS_ITEMS.en.d.ts.map +1 -1
  404. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_PAGINATION.en.d.ts.map +1 -1
  405. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_READ.en.d.ts.map +1 -1
  406. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_SEARCH.en.d.ts.map +1 -1
  407. package/dist/esm/i18n/components/RESOURCES_LAYOUTS_UPDATE.en.d.ts.map +1 -1
  408. package/dist/esm/i18n/components/guidance_announcement.en.d.ts.map +1 -1
  409. package/dist/esm/i18n/components/guidance_banner.en.d.ts.map +1 -1
  410. package/dist/esm/i18n/components/guidance_card.en.d.ts.map +1 -1
  411. package/dist/esm/i18n/components/guidance_checklist.en.d.ts.map +1 -1
  412. package/dist/esm/i18n/components/guidance_checklist_item.en.d.ts.map +1 -1
  413. package/dist/esm/i18n/components/guidance_modal.en.d.ts.map +1 -1
  414. package/dist/esm/i18n/components/guidance_onboarding_view.en.d.ts.map +1 -1
  415. package/dist/esm/i18n/components/guidance_survey.en.d.ts.map +1 -1
  416. package/dist/esm/i18n/components/guidance_tooltip.en.d.ts.map +1 -1
  417. package/dist/esm/i18n/components/guidance_tour.en.d.ts.map +1 -1
  418. package/dist/esm/i18n/components/progression_achievement_badge.en.d.ts.map +1 -1
  419. package/dist/esm/i18n/components/progression_milestone_tracker.en.d.ts.map +1 -1
  420. package/dist/esm/i18n/composite_views/app.creation-board.en.d.ts.map +1 -1
  421. package/dist/esm/i18n/composite_views/app.domain-model.en.d.ts.map +1 -1
  422. package/dist/esm/i18n/index.d.ts.map +1 -1
  423. package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.en.d.ts.map +1 -1
  424. package/dist/esm/i18n/resources/wildoApplicationActorTasks.en.d.ts.map +1 -1
  425. package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.en.d.ts.map +1 -1
  426. package/dist/esm/i18n/resources/workbenchBuildPlanTasks.en.d.ts.map +1 -1
  427. package/dist/esm/i18n/resources/workbenchDomainResources.en.d.ts.map +1 -1
  428. package/dist/esm/i18n/resources/workbenchPlaybooks.en.d.ts.map +1 -1
  429. package/dist/esm/i18n/resources/workbenchRunWriteRecords.en.d.ts.map +1 -1
  430. package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts.map +1 -1
  431. package/dist/esm/i18n/resources/workbenchTraceSessions.en.d.ts.map +1 -1
  432. package/dist/esm/i18n/system_enums/market.en.d.ts.map +1 -1
  433. package/dist/esm/i18n-labelling/models/labelling-unit.models.d.ts +58 -0
  434. package/dist/esm/i18n-labelling/models/labelling-unit.models.d.ts.map +1 -1
  435. package/dist/esm/i18n-labelling/models/labelling-unit.models.js +35 -0
  436. package/dist/esm/i18n-labelling/models/labelling-unit.models.js.map +1 -1
  437. package/dist/esm/i18n-labelling/models/labelling.actors-system.definitions.d.ts.map +1 -1
  438. package/dist/esm/i18n-labelling/models/labelling.actors-system.definitions.js +8 -3
  439. package/dist/esm/i18n-labelling/models/labelling.actors-system.definitions.js.map +1 -1
  440. package/dist/esm/i18n-labelling/services/component-labels-bootstrap.companion.service.d.ts.map +1 -1
  441. package/dist/esm/i18n-labelling/services/labelling-planner.companion.service.d.ts +55 -1
  442. package/dist/esm/i18n-labelling/services/labelling-planner.companion.service.d.ts.map +1 -1
  443. package/dist/esm/i18n-labelling/services/labelling-planner.companion.service.js +178 -73
  444. package/dist/esm/i18n-labelling/services/labelling-planner.companion.service.js.map +1 -1
  445. package/dist/esm/i18n-labelling/services/labelling-spec-context-loader.companion.service.d.ts +3 -3
  446. package/dist/esm/i18n-labelling/services/labelling-spec-context-loader.companion.service.d.ts.map +1 -1
  447. package/dist/esm/i18n-labelling/services/labelling-spec-context-loader.companion.service.js +16 -5
  448. package/dist/esm/i18n-labelling/services/labelling-spec-context-loader.companion.service.js.map +1 -1
  449. package/dist/esm/i18n-labelling/services/labellize-orchestrator.companion.service.d.ts +35 -2
  450. package/dist/esm/i18n-labelling/services/labellize-orchestrator.companion.service.d.ts.map +1 -1
  451. package/dist/esm/i18n-labelling/services/labellize-orchestrator.companion.service.js +68 -29
  452. package/dist/esm/i18n-labelling/services/labellize-orchestrator.companion.service.js.map +1 -1
  453. package/dist/esm/i18n-labelling/services/translate-orchestrator.companion.service.d.ts.map +1 -1
  454. package/dist/esm/i18n-labelling/services/translate-orchestrator.companion.service.js +126 -35
  455. package/dist/esm/i18n-labelling/services/translate-orchestrator.companion.service.js.map +1 -1
  456. package/dist/esm/i18n-labelling/utils/frontend-derived-label-keys.utils.d.ts.map +1 -1
  457. package/dist/esm/i18n-labelling/utils/guidance-keys.utils.d.ts.map +1 -1
  458. package/dist/esm/i18n-labelling/utils/label-file-source.utils.d.ts.map +1 -1
  459. package/dist/esm/i18n-labelling/utils/label-placeholder-drift.utils.d.ts +143 -0
  460. package/dist/esm/i18n-labelling/utils/label-placeholder-drift.utils.d.ts.map +1 -0
  461. package/dist/esm/i18n-labelling/utils/label-placeholder-drift.utils.js +179 -0
  462. package/dist/esm/i18n-labelling/utils/label-placeholder-drift.utils.js.map +1 -0
  463. package/dist/esm/i18n-labelling/utils/orphan-label-artifacts.utils.d.ts +154 -0
  464. package/dist/esm/i18n-labelling/utils/orphan-label-artifacts.utils.d.ts.map +1 -0
  465. package/dist/esm/i18n-labelling/utils/orphan-label-artifacts.utils.js +174 -0
  466. package/dist/esm/i18n-labelling/utils/orphan-label-artifacts.utils.js.map +1 -0
  467. package/dist/esm/i18n-labelling/utils/per-unit-file.utils.d.ts.map +1 -1
  468. package/dist/esm/i18n-labelling/utils/role-lifecycle-keys.utils.d.ts.map +1 -1
  469. package/dist/esm/i18n-labelling/utils/schema-fields-extractor.utils.d.ts +104 -0
  470. package/dist/esm/i18n-labelling/utils/schema-fields-extractor.utils.d.ts.map +1 -1
  471. package/dist/esm/i18n-labelling/utils/schema-fields-extractor.utils.js +163 -18
  472. package/dist/esm/i18n-labelling/utils/schema-fields-extractor.utils.js.map +1 -1
  473. package/dist/esm/i18n-labelling/utils/structured-chunk-completion.utils.d.ts.map +1 -1
  474. package/dist/esm/i18n-labelling/utils/translate-locale-contract.utils.d.ts.map +1 -1
  475. package/dist/esm/index.d.ts.map +1 -1
  476. package/dist/esm/market/services/market-generation.companion.service.d.ts.map +1 -1
  477. package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.d.ts.map +1 -1
  478. package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.js +72 -0
  479. package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.js.map +1 -1
  480. package/dist/esm/meta-workflows/models/application-research-agent.actors-system.definitions.d.ts.map +1 -1
  481. package/dist/esm/meta-workflows/models/application-research-agent.actors-system.definitions.js.map +1 -1
  482. package/dist/esm/meta-workflows/models/brief-adequacy.actors-system.definitions.d.ts +17 -4
  483. package/dist/esm/meta-workflows/models/brief-adequacy.actors-system.definitions.d.ts.map +1 -1
  484. package/dist/esm/meta-workflows/models/brief-adequacy.actors-system.definitions.js +25 -5
  485. package/dist/esm/meta-workflows/models/brief-adequacy.actors-system.definitions.js.map +1 -1
  486. package/dist/esm/meta-workflows/models/meta-workflows-lane.models.d.ts.map +1 -1
  487. package/dist/esm/meta-workflows/models/meta-workflows.actors-system.definitions.d.ts.map +1 -1
  488. package/dist/esm/meta-workflows/models/meta-workflows.actors-system.definitions.js +9 -4
  489. package/dist/esm/meta-workflows/models/meta-workflows.actors-system.definitions.js.map +1 -1
  490. package/dist/esm/meta-workflows/services/__tests__/application-build-task-coding.companion.test-fixtures.d.ts.map +1 -1
  491. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts +3 -9
  492. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts.map +1 -1
  493. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js +48 -28
  494. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js.map +1 -1
  495. package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.d.ts +83 -2
  496. package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.d.ts.map +1 -1
  497. package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.js +197 -4
  498. package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.js.map +1 -1
  499. package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.d.ts.map +1 -1
  500. package/dist/esm/meta-workflows/services/execution-trace-read.companion.service.d.ts.map +1 -1
  501. package/dist/esm/meta-workflows/services/foundation-executor.companion.service.d.ts.map +1 -1
  502. package/dist/esm/meta-workflows/services/playbook-choreography-checkpoint.companion.service.d.ts.map +1 -1
  503. package/dist/esm/meta-workflows/services/playbook-execution-trace.companion.service.d.ts.map +1 -1
  504. package/dist/esm/meta-workflows/services/playbook-run-write-register.companion.service.d.ts.map +1 -1
  505. package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts +37 -1
  506. package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts.map +1 -1
  507. package/dist/esm/meta-workflows/services/playbook-run.companion.service.js +227 -15
  508. package/dist/esm/meta-workflows/services/playbook-run.companion.service.js.map +1 -1
  509. package/dist/esm/meta-workflows/services/playbook-suspended-run.companion.service.d.ts.map +1 -1
  510. package/dist/esm/technical-doc/services/technical-doc.companion.service.d.ts +117 -2
  511. package/dist/esm/technical-doc/services/technical-doc.companion.service.d.ts.map +1 -1
  512. package/dist/esm/technical-doc/services/technical-doc.companion.service.js +258 -69
  513. package/dist/esm/technical-doc/services/technical-doc.companion.service.js.map +1 -1
  514. package/dist/esm/technical-doc/services/technical-documentation-application-derivation.companion.service.d.ts +5 -1
  515. package/dist/esm/technical-doc/services/technical-documentation-application-derivation.companion.service.d.ts.map +1 -1
  516. package/dist/esm/technical-doc/services/technical-documentation-application-derivation.companion.service.js +142 -10
  517. package/dist/esm/technical-doc/services/technical-documentation-application-derivation.companion.service.js.map +1 -1
  518. package/dist/esm/technical-doc/services/technical-documentation-environment-identity.companion.service.d.ts.map +1 -1
  519. package/dist/esm/technical-doc/services/technical-documentation-pilot-assets.companion.service.d.ts.map +1 -1
  520. package/dist/esm/technical-doc/services/technical-documentation-pilot.companion.service.d.ts +2 -1
  521. package/dist/esm/technical-doc/services/technical-documentation-pilot.companion.service.d.ts.map +1 -1
  522. package/dist/esm/technical-doc/services/technical-documentation-pilot.companion.service.js +10 -2
  523. package/dist/esm/technical-doc/services/technical-documentation-pilot.companion.service.js.map +1 -1
  524. package/package.json +17 -17
  525. package/dist/esm/core/runtime/companion-startup-composition-fence.d.ts +0 -44
  526. package/dist/esm/core/runtime/companion-startup-composition-fence.d.ts.map +0 -1
  527. package/dist/esm/core/runtime/companion-startup-composition-fence.js +0 -85
  528. package/dist/esm/core/runtime/companion-startup-composition-fence.js.map +0 -1
  529. package/dist/esm/expert-personas/utils/canonical-json.d.ts +0 -25
  530. package/dist/esm/expert-personas/utils/canonical-json.d.ts.map +0 -1
  531. package/dist/esm/expert-personas/utils/canonical-json.js +0 -45
  532. package/dist/esm/expert-personas/utils/canonical-json.js.map +0 -1
  533. package/dist/esm/i18n/components/LOW_LEVEL_BILLING_PLAN_CHANGE_PREVIEW.en.d.ts +0 -19
  534. package/dist/esm/i18n/components/LOW_LEVEL_BILLING_PLAN_CHANGE_PREVIEW.en.d.ts.map +0 -1
  535. package/dist/esm/i18n/components/LOW_LEVEL_BILLING_PLAN_CHANGE_PREVIEW.en.js +0 -19
  536. package/dist/esm/i18n/components/LOW_LEVEL_BILLING_PLAN_CHANGE_PREVIEW.en.js.map +0 -1
  537. package/dist/esm/i18n/components/LOW_LEVEL_BILLING_PROMOTION_CODE_INPUT.en.d.ts +0 -17
  538. package/dist/esm/i18n/components/LOW_LEVEL_BILLING_PROMOTION_CODE_INPUT.en.d.ts.map +0 -1
  539. package/dist/esm/i18n/components/LOW_LEVEL_BILLING_PROMOTION_CODE_INPUT.en.js +0 -17
  540. package/dist/esm/i18n/components/LOW_LEVEL_BILLING_PROMOTION_CODE_INPUT.en.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"coding-agent-dispatch.companion.service.js","sourceRoot":"","sources":["../../../../../src/claude-cli/services/coding-agent-dispatch.companion.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;;;;;;;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEnD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,aAAa,EACb,kBAAkB,EAClB,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,iBAAiB,EAEj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pB,QAAQ,GAAG,MAAM,CAAC;IACpB,CAAC,CAAC,CAAC;IACH,OAAO;QACL,OAAO;QACP,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YACjB,IAAI,OAAO;gBAAE,OAAO;YACpB,OAAO,GAAG,IAAI,CAAC;YACf,SAAS,CAAC,KAAK,CAAC,CAAC;QACnB,CAAC;QACD,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;YAChB,IAAI,OAAO;gBAAE,OAAO;YACpB,OAAO,GAAG,IAAI,CAAC;YACf,QAAQ,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Application coding-task host — the typed Flows/Actors coding path.\n *\n * `runApplicationCodingTask` admits one typed `ApplicationCodingTaskContract`\n * (the episode runtime's coding revision owner is the caller), renders its\n * prompt from the sealed contract, creates an `Actors_Task` row, spawns the\n * Claude CLI in the background against the application worktree, captures\n * a read-only git change set with per-file attribution, runs the contract's\n * registered verification checks, then PATCHes the task with status/output/\n * artifacts. One admission never spans the multi-minute run (P-16) —\n * callers await the settlement or poll `/tasks/actors/:taskId`. The raw\n * `POST /coding-agent/dispatch` endpoint (caller-composed prompt) was\n * deleted at the first-activation hard cut.\n *\n * # Locking & recursion cap (P-20 / P-19b / P-35)\n *\n * Runs are single-flight, serialized by a cross-process lock on the\n * dedicated target `<saasRoot>/.wildo-saas/state/workspace-mutation.lock`\n * (`withDedicatedFileLock` from `@wildo-ai/platform-config-lib`,\n * proper-lockfile pattern — an in-memory mutex alone is forbidden because\n * the CLI mutates the same worktree from other processes). An in-memory\n * flag fronts the lock for fast 409s. The lock is held for the WHOLE run.\n *\n * The P-35 recursion cap falls out structurally: a dispatched run that\n * calls dispatch (it has shell access and can read the machine-local\n * token) always finds the lock held by ITS OWN run and is rejected 409 —\n * a dispatched run can never dispatch. Deliberately, the lock does NOT\n * gate Paul's parallel sessions (P-19b): CLAUDE.md forbids session\n * coordination; per-file attribution is the compensation, not exclusion.\n *\n * # Traceability (P-21)\n *\n * L2 runs are NOT traced by the engine `AgentCallTraceSink` — the direct\n * claude-cli lane bypasses it AND Bottleneck rate limiting. Do not assume\n * traced-for-free: this service owns its companion-traceability events\n * (DEBUG) and artifacts (DEBUG_VERBOSE); a sink wrapper emission is\n * deferred. The background phase runs under an INTERNAL trace session\n * (`createInternalSession`) because the HTTP request session ends at the\n * 202-style response.\n *\n * # Run limits (P-18)\n *\n * Defaults 30 min / 10 MiB; request-overridable up to hard caps\n * 60 min / 32 MiB. The byte cap REJECTS (kills the run), it does not\n * truncate. Args stay `--print` + `--model` (no extraArgs field), prompt\n * on stdin, env = `{ PATH, HOME, SHELL, TERM }` (composed inside\n * the ACP session runner).\n */\n\nimport { isAbsolute, join, normalize, relative, sep, dirname } from 'node:path';\nimport { existsSync, realpathSync } from 'node:fs';\n\nimport { inject, injectable } from 'inversify';\nimport {\n AgentsBackendService,\n ErrorBuilderBackendService,\n LoggerService,\n SAAS_SERVICE_TYPES,\n executeBoundedSubprocess,\n describeCaughtError,\n} from '@wildo-ai/saas-backend-lib';\nimport {\n Actor_Task_Topics,\n type AgentTraceContext,\n ErrorCustomMessageReference,\n ErrorType,\n FlowsActors_IO_PartKind,\n FlowsActors_Status,\n isWildoBackendError,\n type ArtifactInstance,\n type FlowsActors_Agent_Invocation,\n} from '@wildo-ai/saas-models';\nimport {\n CodingAgent_EndOfTurnClassification,\n CodingAgent_OperationContext_BaseSchema,\n CodingAgent_RunTaskInputSchema,\n CodingAgent_RunTaskOutputSchema,\n CodingAgent_SessionSuspensionSchema,\n CodingAgent_StopReason,\n type CodingAgent_RunTaskOutput,\n type CodingAgent_SessionSuspension,\n type CodingAgent_Usage,\n} from '@wildo-ai/external-connectors-models';\nimport {\n ApplicationCodingTaskContractSchema,\n type ApplicationCodingTaskContract,\n} from '@wildo-ai/saas-specifications/application-creation';\nimport {\n getWorkspaceMutationLockPath as resolveWorkspaceMutationLockPath,\n withDedicatedFileLock,\n} from '@wildo-ai/platform-config-lib';\n\nimport { sanitizeWorkbenchCreationPlaneIdentity } from '@wildo-ai/platform-core-shared';\nimport { COMPANION_SERVICE_TYPES } from '../../core/inject/models/service-types';\nimport type { CompanionContext } from '../../core/context/companion-context';\nimport type {\n CompanionExecutionSessionContext,\n} from '../../core/traceability/companion-traceability.models';\nimport { CompanionTraceabilityLevel, CompanionTraceAliasKind } from '../../core/traceability/companion-traceability.models';\nimport { CompanionTraceabilityService } from '../../core/traceability/companion-traceability.service';\nimport { CompanionIntrospectionService } from '../../core/introspection/services/companion-introspection.companion.service';\nimport { CompanionExecutionsCompanionService } from '../../executions/services/companion-executions.companion.service';\nimport {\n CompanionCreateActorTaskRequestSchema,\n CompanionUpdateActorTaskRequestSchema,\n type CompanionCodingAgentStatusResponse,\n} from '../../companion-api/companion-api.schemas';\nimport { GitChangeSetCompanionService } from './git-change-set.companion.service';\nimport {\n APPLICATION_CODING_AGENT_REF,\n APPLICATION_CODING_TURN_CLASSIFIER_AGENT_REF,\n CodingTurnEndClassificationOutputSchema,\n APPLICATION_CODING_AGENT_REFS,\n isApplicationCodingAgentRef,\n resolveSelectedApplicationCodingAgentBinding,\n} from '../../meta-workflows/models/application-coding-agent.actors-system.definitions';\nimport {\n ChangeSetAttributionClass,\n ApplicationCodingTaskDisposition,\n type ApplicationCodingTaskRunAdmission,\n type ApplicationCodingTaskVerificationPlan,\n DISPATCH_DEFAULT_MAX_CAPTURED_BYTES,\n DISPATCH_DEFAULT_TIMEOUT_MS,\n DISPATCH_HARD_MAX_CAPTURED_BYTES,\n DISPATCH_HARD_MAX_TIMEOUT_MS,\n VerificationKind,\n renderApplicationCodingTaskAgentPrompt,\n resolveApplicationCodingTaskVerificationPlans,\n type GitChangeSetCapture,\n type GitWorktreeSnapshot,\n} from '../models/coding-agent-dispatch.models';\n\n/** Fixed, non-overridable limits for the verification hook subprocess. */\nconst VERIFICATION_TIMEOUT_MS = 10 * 60_000;\nconst VERIFICATION_MAX_CAPTURED_BYTES = 10 * 1024 * 1024;\n\n\n/**\n * The session frames worth retaining on the durable row: what the agent DID and\n * what it changed. Message chunks are already summarised by the output tail, and\n * usage frames are superseded by the recorded totals.\n */\nconst RETAINED_CODING_SESSION_EVENT_KINDS: ReadonlySet<string> = new Set(['tool_call', 'tool_call_update', 'plan']);\n/** Ceiling on retained frames — a bound, not a sample: excess is dropped, never summarised. */\nconst RETAINED_CODING_SESSION_FRAME_LIMIT = 200;\n\n/** Tail size persisted on the task row; full streams go to traceability artifacts. */\nconst OUTPUT_TAIL_CHARS = 16_000;\n\ntype DispatchedTaskRow = Awaited<\n ReturnType<CompanionExecutionsCompanionService['createActorTask']>\n>;\n\ninterface ActiveRunState {\n taskId: string;\n startedAt: string;\n /** Cancels the in-flight coding session. Cooperative first, kill second. */\n abortController: AbortController;\n}\n\n/**\n * A run that PARKED on a genuine question, retained in memory so the operator's\n * answer can resume the SAME agent session with the task's full context.\n *\n * In-process only, by design: the agent persists the session on disk (so\n * `session/load` could resume it after a restart), but the task CONTRACT — the\n * mutation scope the resume must still be held to, the verification plan, the\n * original baseline the final change set is measured against — lives here. A\n * companion restart therefore drops the answerable state, which surfaces as a\n * typed refusal rather than a resume that has forgotten the task's bounds.\n */\nexport interface ParkedCodingSessionState {\n readonly durableTask: DispatchedTaskRow;\n readonly task: ApplicationCodingTaskContract;\n readonly verificationPlans: readonly ApplicationCodingTaskVerificationPlan[];\n readonly baseline: GitWorktreeSnapshot;\n readonly suspension: CodingAgent_SessionSuspension;\n readonly parkedAt: string;\n}\n\n/** Local narrow: is this an indexable object (not null, not an array)? */\nfunction isRecordValue(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/** One live frame relayed to an SSE subscriber: an agent event or a ladder state change. */\nexport interface CodingSessionLiveFrame {\n readonly channel: 'event' | 'state';\n readonly payload: unknown;\n}\n\ninterface VerificationOutcome {\n kind: VerificationKind;\n path: string | null;\n success: boolean;\n message: string;\n stdoutTail: string;\n stderrTail: string;\n}\n\n/** Result of checking every attributed changed-during-run file against the sealed task scope. */\ninterface ApplicationCodingTaskScopeAssessment {\n allowed: boolean;\n violatingPaths: string[];\n /**\n * A commit landed inside the run window, so this window's attribution is\n * INCOMPLETE: a commit empties the dirty set every other class here is\n * computed from, and a parallel session's commit is indistinguishable from\n * the agent's own.\n *\n * RECORDED, NOT REFUSED — decided 2026-08-19, and the reasoning is the same\n * rule the plan applies to every other strictness in this vertical: exactness\n * is retained where a protected, accepted-state or real-effect consumer needs\n * it, and nowhere else. A coding run produces a WORKING result; it mutates no\n * accepted truth. Refusing the whole run here bought no protection of\n * anything accepted, while on a shared tree with parallel sessions ANY commit\n * overlapping ANY run — including one touching nothing the agent touched —\n * failed that run, with no worktree isolation to fall back on (ruled out for\n * this application) and no remedy a single session can enforce.\n *\n * What replaces the refusal is visibility that a consumer cannot miss: the\n * committed paths are recovered into the change set as\n * `COMMITTED_DURING_RUN`, and this flag rides on the recorded result. The\n * OBLIGATION moves with it — whatever later accepts this working result must\n * treat `historyMutated` as attribution it cannot rely on, and must not\n * promote it without review. That is the acceptance tier's job, which is\n * where exactness belongs.\n */\n historyMutated: boolean;\n}\n\n/**\n * Scope checking is deliberately based on the post-run attribution capture,\n * not only clean-baseline files. A baseline-dirty file changed again during a\n * run is not safely attributable to the Agent, but it is still a real effect\n * inside the host window and must not be used to bypass a declared boundary.\n */\nfunction assessApplicationCodingTaskMutationScope(\n changeSet: GitChangeSetCapture,\n allowedPrefixes: readonly string[],\n prohibitedPrefixes: readonly string[],\n): ApplicationCodingTaskScopeAssessment {\n const normalizedAllowed = allowedPrefixes.map(normalizeApplicationRelativePrefix);\n const normalizedProhibited = prohibitedPrefixes.map(normalizeApplicationRelativePrefix);\n /*\n * Committed paths are deliberately EXCLUDED from the scope decision. They are\n * present in `changeSet.files` (as `COMMITTED_DURING_RUN`) so nothing is\n * invisible, but nobody can attribute them: a parallel session's commit and\n * the agent's own look identical from here, so refusing on them would fail\n * runs for other people's work. `historyMutated` carries that fact forward\n * instead, and the acceptance tier decides what an unattributable window is\n * worth.\n */\n /*\n * A disappearance is only a VIOLATION when the run can be held responsible for it, and a commit\n * landing inside the window is precisely when it cannot.\n *\n * `disappearedFromBaseline` is \"dirty at baseline, no longer dirty post-run\", which has two\n * causes that look identical from here: the agent reverted or deleted the file (attributable,\n * and a real boundary breach if the path is out of scope), or a commit emptied the dirty set\n * (not attributable — a parallel session's commit and the agent's own are indistinguishable,\n * which is the exact reasoning the `COMMITTED_DURING_RUN` exclusion above already applies).\n *\n * Including them unconditionally made the two treatments contradict each other: the committed\n * PATHS were excluded as unattributable while the disappearance THAT SAME COMMIT CAUSED was\n * used to fail the run. Measured 2026-08-28 on wonder-crm — a run that stopped cleanly at\n * `end_turn`, honoured every permission decision and wrote NOTHING (`runExclusive: 0`,\n * `appearedDuringRun: 0`) was recorded `mutation_scope_violation` against 13 engine paths it\n * never touched, because a human committed at 17:47:56 and 17 baseline-dirty files left the\n * set. The field's own contract already said they \"are NOT attributed change-set entries\".\n *\n * So the exclusion is conditional, not blanket: with no commit in the window a disappearance\n * IS the run's doing and still fails it. Only the case the run cannot be responsible for is\n * dropped, and it stays visible — the paths remain on `disappearedFromBaseline`, and\n * `historyMutated` tells the acceptance tier the window is unattributable.\n */\n const disappearancesAttributableToTheRun = changeSet.headMovedDuringRun\n ? []\n : changeSet.disappearedFromBaseline;\n\n const violatingPaths = [\n ...changeSet.files\n .filter((entry) => entry.attribution !== ChangeSetAttributionClass.COMMITTED_DURING_RUN)\n .map((entry) => entry.path),\n ...disappearancesAttributableToTheRun,\n ]\n .filter((path) => {\n const normalizedPath = normalizeApplicationRelativePrefix(path);\n const inAllowedScope = normalizedAllowed.some((prefix) => matchesApplicationRelativePrefix(normalizedPath, prefix));\n const inProhibitedScope = normalizedProhibited.some((prefix) => matchesApplicationRelativePrefix(normalizedPath, prefix));\n return !inAllowedScope || inProhibitedScope;\n });\n return {\n // `historyMutated` does NOT gate admissibility (see the field's contract):\n // it is recorded so the consumer of this working result can see that the\n // window is unattributable, not used to fail a run that protected nothing.\n allowed: violatingPaths.length === 0,\n violatingPaths,\n historyMutated: changeSet.headMovedDuringRun,\n };\n}\n\n/**\n * The LIVE counterpart of {@link assessApplicationCodingTaskMutationScope}:\n * decides, while the agent is still running, whether one absolute path is\n * inside the task's declared mutation scope.\n *\n * Deliberately reuses the SAME normalisation and boundary matching as the\n * post-hoc assessment. Two predicates answering \"is this path in scope?\" with\n * different rules would produce the worst possible outcome — a run permitted\n * live and then judged a scope violation afterwards, or the reverse.\n *\n * It NARROWS and never widens: the permission ceiling still decides the KIND of\n * operation, and this only refuses a path that ceiling would otherwise allow.\n * A path outside the workspace is refused outright rather than reasoned about.\n */\nexport function buildApplicationCodingTaskLocationPredicate(\n workspaceRootPath: string,\n allowedPrefixes: readonly string[],\n prohibitedPrefixes: readonly string[],\n): (absolutePath: string) => boolean {\n const normalizedAllowed = allowedPrefixes.map(normalizeApplicationRelativePrefix);\n const normalizedProhibited = prohibitedPrefixes.map(normalizeApplicationRelativePrefix);\n\n /*\n * Compare against BOTH the configured root and its physical realpath.\n *\n * Agents report CANONICAL absolute paths. Measured live on 2026-08-27: with a\n * workspace under `/var/folders/...` (a macOS symlink to `/private/var/...`),\n * the agent's permission request named the `/private/...` form while the\n * configured root was the `/var/...` form, so an IN-SCOPE edit was refused and\n * the run reported the agent declining to do its job. A scope predicate that\n * silently denies everything is worse than one that denies nothing, because\n * it looks like the agent failing rather than the guard misfiring.\n */\n const candidateRoots = [workspaceRootPath];\n try {\n const physicalRoot = realpathSync.native(workspaceRootPath);\n if (physicalRoot !== workspaceRootPath) {\n candidateRoots.push(physicalRoot);\n }\n } catch {\n // An unresolvable root is left as authored; the relative check below still\n // refuses anything outside it.\n }\n\n return (absolutePath: string): boolean => {\n if (!isAbsolute(absolutePath)) {\n return false;\n }\n const relativePath = candidateRoots\n .map((root) => relative(root, absolutePath))\n .find((candidate) => candidate && !candidate.startsWith('..') && !isAbsolute(candidate));\n if (!relativePath) {\n return false;\n }\n const normalizedPath = normalizeApplicationRelativePrefix(relativePath.split(sep).join('/'));\n const inAllowedScope = normalizedAllowed.some((prefix) => matchesApplicationRelativePrefix(normalizedPath, prefix));\n const inProhibitedScope = normalizedProhibited.some((prefix) => matchesApplicationRelativePrefix(normalizedPath, prefix));\n return inAllowedScope && !inProhibitedScope;\n };\n}\n\nfunction normalizeApplicationRelativePrefix(value: string): string {\n return value.replace(/\\\\/g, '/').replace(/^\\.\\//, '').replace(/\\/+$/, '');\n}\n\n/** Prefix matches require a path boundary: `src/app` does not admit `src/application`. */\nfunction matchesApplicationRelativePrefix(path: string, prefix: string): boolean {\n return path === prefix || path.startsWith(`${prefix}/`);\n}\n\n@injectable()\nexport class CodingAgentDispatchCompanionService {\n private readonly logDebug: (message: string, context?: Record<string, unknown>) => void;\n\n /**\n * In-memory single-flight flag — the FAST 409 in front of the\n * cross-process lockfile, never a replacement for it (P-20).\n */\n private activeRun: ActiveRunState | null = null;\n /**\n * Per-process settlement signal of every application coding task THIS\n * process admitted: resolved when the background run has recorded its\n * terminal durable result (or given up trying). This is the \"owner's\n * completion hook\" the episode driver waits on instead of polling the\n * Actor Task row; a task admitted by a previous process has no entry here,\n * which is correct — restart reconciliation already terminalized it.\n */\n private readonly applicationCodingTaskSettlements = new Map<string, { readonly promise: Promise<void>; resolve(): void }>();\n\n /**\n * Tasks parked on a question, keyed by task id — the answerable set. A task\n * enters here when a run returns a `suspension` and leaves when it is answered\n * (resumed) or explicitly abandoned. See {@link ParkedCodingSessionState}.\n */\n private readonly parkedCodingSessions = new Map<string, ParkedCodingSessionState>();\n\n /**\n * Live-frame subscribers keyed by task id. Fed by the coding session's own\n * event stream and the ladder's state transitions while a run is active;\n * drained by the SSE endpoint. Best-effort throughout — a slow or throwing\n * subscriber never touches the run it observes.\n */\n private readonly codingSessionSubscribers = new Map<string, Set<(frame: CodingSessionLiveFrame) => void>>();\n\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger)\n private readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.ErrorBuilderService)\n private readonly errorBuilder: ErrorBuilderBackendService,\n @inject(COMPANION_SERVICE_TYPES.CompanionContext)\n private readonly companionContext: CompanionContext,\n @inject(SAAS_SERVICE_TYPES.AgentsBackendService)\n private readonly agentsService: AgentsBackendService,\n @inject(COMPANION_SERVICE_TYPES.GitChangeSetService)\n private readonly gitChangeSetService: GitChangeSetCompanionService,\n @inject(COMPANION_SERVICE_TYPES.ExecutionsService)\n private readonly executionsService: CompanionExecutionsCompanionService,\n @inject(COMPANION_SERVICE_TYPES.TraceabilityService)\n private readonly traceabilityService: CompanionTraceabilityService,\n @inject(COMPANION_SERVICE_TYPES.IntrospectionService)\n private readonly introspectionService: CompanionIntrospectionService,\n ) {\n this.logDebug = this.logger.debugByType('CodingAgentDispatchCompanionService');\n this.logger.setDebugTypeLogging('CodingAgentDispatchCompanionService', true);\n }\n\n /**\n * Admit one application-authored coding task onto the normal Flows/Actors\n * Claude Code path — the ONLY coding entry since the raw dispatch endpoint\n * was deleted at the first-activation hard cut. This method accepts only the\n * sealed typed task produced by application composition. The returned\n * acknowledgement is intentionally non-terminal; a completed Actor Task\n * records a working code result and its evidence, never accepted\n * application truth.\n */\n public async runApplicationCodingTask(\n rawTask: ApplicationCodingTaskContract,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<ApplicationCodingTaskRunAdmission> {\n /*\n * Both admission refusals below are TYPED.\n *\n * A malformed contract surfaced as a raw `ZodError` and an unregistered\n * check ref as a plain `Error`, so the two refusals a caller can actually\n * provoke reached the transport as unclassified failures and answered 500\n * INTERNAL — indistinguishable from the host being broken. They are\n * VALIDATION: the request is refused, nothing was locked, created or run.\n */\n const task = this.admitTypedInput(\n () => ApplicationCodingTaskContractSchema.parse(rawTask),\n 'Application coding task contract is not valid.',\n );\n // Resolve before acquiring the lock or creating a task. A semantic check\n // name is not a command and cannot silently fall back to an arbitrary\n // workspace typecheck.\n const verificationPlans = this.admitTypedInput(\n () => resolveApplicationCodingTaskVerificationPlans(task.verificationIntent.requiredChecks),\n 'Application coding task names an unregistered verification check.',\n );\n const traceStep = this.createOperationTraceStep(sessionContext, 'application-coding-task-admission');\n const renderedPrompt = renderApplicationCodingTaskAgentPrompt(task);\n await this.traceOperationStart({\n sessionContext,\n step: traceStep,\n type: 'application-coding-task-admission-start',\n summary: `Admit application coding task ${task.taskRef}`,\n payload: this.buildApplicationCodingTaskTraceSummary(task),\n artifactFileName: 'application-coding-task-input.txt',\n artifactContent: renderedPrompt,\n });\n\n if (this.activeRun) {\n throw this.buildDispatchConflictError(\n `A coding-agent run is already active (task ${this.activeRun.taskId}, started ${this.activeRun.startedAt}). `\n + 'Application coding tasks share the same cross-process mutation lock.',\n );\n }\n\n const admission = createDeferred<{ task: DispatchedTaskRow; baseline: GitWorktreeSnapshot }>();\n const backgroundRun = withDedicatedFileLock(\n this.getWorkspaceMutationLockPath(),\n async () => {\n let admitted: { task: DispatchedTaskRow; baseline: GitWorktreeSnapshot };\n try {\n const baseline = await this.gitChangeSetService.captureWorktreeSnapshot();\n const durableTask = await this.createApplicationCodingTask(task, baseline, sessionContext);\n this.activeRun = {\n taskId: durableTask._id,\n startedAt: new Date().toISOString(),\n abortController: new AbortController(),\n };\n admitted = { task: durableTask, baseline };\n // Registered BEFORE the admission is resolved, so a caller that\n // awaits the settlement right after admission can never miss it.\n const settlement = createDeferred<void>();\n this.applicationCodingTaskSettlements.set(durableTask._id, { promise: settlement.promise, resolve: () => settlement.resolve(undefined) });\n admission.resolve(admitted);\n } catch (error) {\n admission.reject(error);\n return;\n }\n\n try {\n await this.executeApplicationCodingTask(task, renderedPrompt, verificationPlans, admitted.task, admitted.baseline);\n } finally {\n this.activeRun = null;\n this.applicationCodingTaskSettlements.get(admitted.task._id)?.resolve();\n }\n },\n { retries: { retries: 0 } },\n );\n backgroundRun.catch((error: unknown) => {\n admission.reject(this.mapLockError(error));\n this.logDebug('Application coding-task background run chain terminated with error', {\n error: describeCaughtError(error),\n taskRef: task.taskRef,\n });\n });\n\n const admitted = await admission.promise;\n const response: ApplicationCodingTaskRunAdmission = {\n taskId: admitted.task._id,\n status: FlowsActors_Status.PROCESSING,\n taskRef: task.taskRef,\n baselineHeadSha: admitted.baseline.headSha,\n baselineDirtyFileCount: Object.keys(admitted.baseline.files).length,\n };\n await this.traceOperationSuccess({\n sessionContext,\n step: traceStep,\n type: 'application-coding-task-admission-success',\n summary: `Admitted application coding task ${task.taskRef} as Actor Task ${admitted.task._id}`,\n payload: response,\n artifactFileName: 'application-coding-task-admission.json',\n artifactContent: response,\n });\n return response;\n }\n\n /**\n * The settlement of one application coding task admitted by THIS process:\n * resolves once its terminal durable result has been recorded (success or\n * failure) — the only moment a waiting episode can read a non-PROCESSING\n * row. `null` for a task this process did not admit (a previous process's\n * row, already terminalized by restart reconciliation, or an unknown id):\n * there is nothing to wait for, and a caller must not spin on it.\n */\n public awaitApplicationCodingTaskSettlement(taskId: string): Promise<void> | null {\n return this.applicationCodingTaskSettlements.get(taskId)?.promise ?? null;\n }\n\n /**\n * Reconcile only a previous process's unfinished application-coding rows.\n *\n * A companion restart cannot prove the previous Claude Code subprocess is\n * still running. Retrying could duplicate a worktree mutation, while\n * reverting would destroy evidence. The safe v0 result is therefore a\n * terminal physical abort plus an explicit human-review disposition. Root\n * wires this method into ordinary startup in a later, separately reviewed\n * join; this source slice never invokes it automatically.\n */\n public async reconcileInterruptedApplicationCodingTasks(\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<{ reconciledTaskIds: string[] }> {\n const processingTasks = await this.executionsService.listActorTasks({\n status: FlowsActors_Status.PROCESSING,\n limit: 200,\n }, sessionContext);\n const reconciledTaskIds: string[] = [];\n\n for (const task of processingTasks) {\n // MEMBERSHIP, not equality with one constant: with a second declared coding\n // agent, equality silently skips every task addressed to it — a task never\n // claimed and never reported, which is worse than one that fails loudly.\n if (!isApplicationCodingAgentRef(task.actors?.actorRef)) continue;\n /*\n * A PARKED task is deliberately PROCESSING with no live child — its agent process is already\n * closed and the answer resumes the persisted session via `session/load`. That is the ONE\n * PROCESSING shape a restart must NOT terminalize: surviving the restart is the suspension's\n * whole design (`reconstructParkedCodingTaskForResume` re-selects it from the build plan).\n * Measured 2026-09-04, first live park on a restart: this sweep terminalized the parked row\n * and nulled its suspension three seconds before the operator's answer arrived, so the\n * restart-durability door refused with \"no coding task is awaiting an answer\". Only a FRESH,\n * RESUMABLE suspension is exempt — an expired `parkedUntil`, or an agent that cannot\n * `session/load`, leaves a question nobody can answer on the same session, and terminalizing\n * it for review is then the honest outcome.\n */\n const parkedOutput = (task as { output?: { disposition?: unknown; suspension?: unknown } }).output;\n if (parkedOutput?.disposition === ApplicationCodingTaskDisposition.AWAITING_OPERATOR_INPUT) {\n const parsedSuspension = CodingAgent_SessionSuspensionSchema.safeParse(parkedOutput.suspension);\n const stillAnswerable = parsedSuspension.success\n && parsedSuspension.data.resumable\n && Date.parse(parsedSuspension.data.parkedUntil) > Date.now();\n if (stillAnswerable) continue;\n }\n let currentSnapshot: GitWorktreeSnapshot | null = null;\n let captureError: unknown = null;\n try {\n currentSnapshot = await this.gitChangeSetService.captureWorktreeSnapshot();\n } catch (error) {\n captureError = error;\n }\n\n const updatePayload = CompanionUpdateActorTaskRequestSchema.parse({\n status: FlowsActors_Status.ABORTED,\n output: {\n succeeded: false,\n disposition: ApplicationCodingTaskDisposition.INTERRUPTED_REQUIRES_REVIEW,\n recoveryEvidence: currentSnapshot\n ? {\n headSha: currentSnapshot.headSha,\n dirtyFileCount: Object.keys(currentSnapshot.files).length,\n capturedAt: currentSnapshot.capturedAt,\n }\n : null,\n ...(captureError ? { recoveryCaptureError: buildOutputErrorPayload(captureError) } : {}),\n },\n });\n await this.executionsService.updateActorTask(task._id, updatePayload, sessionContext);\n reconciledTaskIds.push(task._id);\n }\n\n return { reconciledTaskIds };\n }\n\n /**\n * Readiness snapshot for the status route. HONESTY CONTRACT: the\n * underlying `isAvailable()` checks ONLY that the provider registry\n * exposes an AGENT_CLIENT_PROTOCOL contract for anthropic — it does NOT\n * guarantee the ACP adapter is installed, spawnable, or authenticated. A\n * `true` here can still be followed by a spawn/auth failure at run time.\n */\n /**\n * The cross-process workspace-mutation lock path (P-19b) — one lock for\n * every mutating coding run against this application worktree.\n */\n public getWorkspaceMutationLockPath(): string {\n return resolveWorkspaceMutationLockPath(this.companionContext.saasRoot);\n }\n\n /**\n * Cancel the in-flight coding run, if there is one.\n *\n * Cooperative by construction: this signals the session, and the runner sends\n * `session/cancel` and waits before killing anything. The run therefore\n * TERMINALISES NORMALLY — with stop reason `cancelled` and a captured change\n * set — rather than vanishing. That distinction is the whole point: an\n * operator who stops a run still needs to know what it had already written.\n *\n * Returns the task that was asked to stop, or `null` when nothing is running.\n * Idempotent: cancelling an already-cancelled run signals an aborted\n * controller again, which is a no-op.\n */\n public cancelActiveApplicationCodingTask(): { taskId: string; startedAt: string } | null {\n const active = this.activeRun;\n if (!active) {\n return null;\n }\n this.logDebug('Cancelling active application coding task', { taskId: active.taskId });\n active.abortController.abort();\n return { taskId: active.taskId, startedAt: active.startedAt };\n }\n\n public getStatus(): CompanionCodingAgentStatusResponse {\n return {\n // Reports a fact this service can actually establish: whether the coding\n // agent is registered. It deliberately does NOT claim the transport is\n // usable — that depends on the provider configuration and on an agent\n // process this service has not started, and a status field that overstates\n // its knowledge is worse than one that is narrow about it.\n // Every declared agent must resolve, not merely the default: a registry\n // missing the SELECTED agent reports healthy while dispatch refuses.\n codingAgentRegistered: APPLICATION_CODING_AGENT_REFS.every(\n (ref) => this.agentsService.getAgent(ref) !== undefined,\n ),\n activeRun: this.activeRun ? { taskId: this.activeRun.taskId, startedAt: this.activeRun.startedAt } : null,\n // The answerable set: what is parked waiting for an operator response.\n pendingQuestions: this.listPendingCodingQuestions(),\n limits: {\n defaultTimeoutMs: DISPATCH_DEFAULT_TIMEOUT_MS,\n hardMaxTimeoutMs: DISPATCH_HARD_MAX_TIMEOUT_MS,\n defaultMaxCapturedBytes: DISPATCH_DEFAULT_MAX_CAPTURED_BYTES,\n hardMaxCapturedBytes: DISPATCH_HARD_MAX_CAPTURED_BYTES,\n },\n lockFilePath: this.getWorkspaceMutationLockPath(),\n };\n }\n\n /**\n * Persist only replayable task identity and guard evidence, never\n * prompt/context bytes.\n *\n * CORRELATION BACK TO THE EPISODE runs through `input.candidateRef`, which is\n * the assessment episode's working-subject identity for the iteration that\n * composed this task — the same value the private checkpoint carries as\n * `basis.episode.candidateRef`. It is recorded here deliberately so the join\n * exists in BOTH directions: the checkpoint names the taskId once the task is\n * admitted, and this row names the candidate that caused it, so an auditor\n * starting from a workspace mutation can reach the episode without scanning\n * every checkpoint.\n *\n * A dedicated `episodeRef` column is NOT added: no caller supplies one yet\n * (the coding revision owner lands later), and a field with no producer is a\n * dormant surface that later readers mistake for a guarantee. The candidate\n * ref is exact per ITERATION, which is the granularity an auditor wants.\n */\n private async createApplicationCodingTask(\n task: ApplicationCodingTaskContract,\n baseline: GitWorktreeSnapshot,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<DispatchedTaskRow> {\n const payload = CompanionCreateActorTaskRequestSchema.parse({\n title: `Application coding task ${task.taskRef}`,\n /* The cross-plane join key — the board's build-plan row this task executes (Phase 4, R5). */\n workbenchBuildPlanTaskId: sanitizeWorkbenchCreationPlaneIdentity(task.taskRef),\n description: `Typed application coding task for ${task.objectiveRef}; acceptance remains outside the coding host.`,\n topic: Actor_Task_Topics.IMPLEMENTATION,\n status: FlowsActors_Status.PROCESSING,\n // The SELECTED agent, resolved once at creation and carried on the row —\n // so a task records which agent it was addressed to, and a selection\n // changed between creation and claim cannot silently redirect it.\n actors: { actorRef: resolveSelectedApplicationCodingAgentBinding().ref },\n input: {\n taskRef: task.taskRef,\n objectiveRef: task.objectiveRef,\n candidateRef: task.candidateRef,\n mutationScope: task.mutationScope,\n contextPlan: {\n planRef: task.contextPlan.planRef,\n objectiveRef: task.contextPlan.objectiveRef,\n },\n contextSelection: {\n planRef: task.contextSelection.planRef,\n selectedSourceRefs: task.contextSelection.selectedSources.map((source) => source.sourceRef),\n selectedSourceCount: task.contextSelection.selectedSources.length,\n },\n verificationIntent: task.verificationIntent,\n installedSkillRefs: task.installedSkillRefs,\n baseline: {\n headSha: baseline.headSha,\n dirtyFileCount: Object.keys(baseline.files).length,\n capturedAt: baseline.capturedAt,\n },\n },\n context: {},\n startedAt: new Date().toISOString(),\n });\n return this.executionsService.createActorTask(payload, sessionContext);\n }\n\n /**\n * Executes the normal Agent invocation and lands the full working-result\n * evidence. This method runs inside the worktree lock and therefore is the\n * sole typed path allowed to observe its own before/after Git boundary.\n */\n private async executeApplicationCodingTask(\n task: ApplicationCodingTaskContract,\n renderedPrompt: string,\n verificationPlans: readonly ApplicationCodingTaskVerificationPlan[],\n durableTask: DispatchedTaskRow,\n baseline: GitWorktreeSnapshot,\n /**\n * Present when this run ANSWERS a parked question rather than starting the\n * task: the agent session is resumed by id via `session/load` and the answer\n * is delivered as the next turn. The task's mutation scope, verification plan\n * and original baseline are unchanged — the resume is held to exactly the\n * bounds the first run was.\n */\n resume?: { readonly continuationOfSessionId: string; readonly answerPrompt: string },\n ): Promise<void> {\n let runSession: CompanionExecutionSessionContext | undefined;\n let runStep: ReturnType<CompanionTraceabilityService['createStep']> | undefined;\n const traceabilityErrors: unknown[] = [];\n const traceBestEffort = async (operation: string, write: () => Promise<void>): Promise<void> => {\n try {\n await write();\n } catch (error) {\n // Traceability is required evidence, but it must not become a control\n // flow escape that leaves the durable task PROCESSING after possible\n // source changes. The final task row records this failure and remains\n // visibly non-accepted for explicit follow-up.\n traceabilityErrors.push(error);\n this.logger.error('Application coding-task trace operation failed', {\n taskId: durableTask._id,\n taskRef: task.taskRef,\n operation,\n error: describeCaughtError(error),\n });\n }\n };\n await traceBestEffort('initialize-session', async () => {\n runSession = this.traceabilityService.createInternalSession({\n label: 'application-coding-task-run',\n metadata: { taskId: durableTask._id, taskRef: task.taskRef },\n });\n if (!runSession) return;\n await this.traceabilityService.registerAlias(runSession, CompanionTraceAliasKind.ACTOR_TASK, durableTask._id);\n runStep = this.createOperationTraceStep(runSession, 'application-coding-task-run');\n });\n const traceContext: AgentTraceContext = {\n label: `application-coding-task:${task.taskRef}`,\n attributes: {\n taskId: durableTask._id,\n taskRef: task.taskRef,\n objectiveRef: task.objectiveRef,\n candidateRef: task.candidateRef,\n },\n };\n const invocation: FlowsActors_Agent_Invocation<\n typeof CodingAgent_RunTaskInputSchema,\n typeof CodingAgent_RunTaskOutputSchema,\n typeof CodingAgent_OperationContext_BaseSchema\n > = {\n agentRef: APPLICATION_CODING_AGENT_REF,\n initiator: {},\n invocationContext: [],\n // A resume delivers the operator's ANSWER as the turn and re-enters the\n // parked session; a first run delivers the rendered task.\n input: resume\n ? { prompt: resume.answerPrompt, continuationOfSessionId: resume.continuationOfSessionId }\n : { prompt: renderedPrompt },\n output: { finalMessage: '', stopReason: CodingAgent_StopReason.END_TURN },\n executionContext: { callTimestamp: new Date().toISOString() },\n artifactBindings: [],\n };\n\n const startedAtMs = Date.now();\n let runError: unknown = null;\n let agentOutput = '';\n let codingUsage: CodingAgent_Usage | undefined;\n let codingDeniedPermissionCount: number | undefined;\n let codingPermissionDecisions: CodingAgent_RunTaskOutput['permissionDecisions'];\n let agentStopReason: CodingAgent_StopReason | undefined;\n /*\n * Counted in full, RETAINED in part.\n *\n * The previous shape pushed every notification into an unbounded array and\n * then persisted only its length — so a 30-minute run grew memory the\n * process never read, and the tool-call and diff frames (the reason to\n * observe a session at all) were collected and discarded. Now the count is a\n * counter, and only the frames a reader would actually open are retained, up\n * to a fixed ceiling.\n */\n let codingSessionEventCount = 0;\n const retainedCodingSessionFrames: Array<{ readonly kind: string; readonly payload: unknown }> = [];\n await traceBestEffort('record-start', () => this.traceOperationStart({\n sessionContext: runSession,\n step: runStep,\n type: 'application-coding-task-run-start',\n summary: `Run application coding task ${task.taskRef}`,\n payload: this.buildApplicationCodingTaskTraceSummary(task),\n artifactFileName: 'application-coding-task-input.txt',\n artifactContent: renderedPrompt,\n }));\n try {\n const response = await this.agentsService.invokeAgent(\n invocation,\n traceContext,\n {\n workspaceRootPath: this.companionContext.saasRoot,\n // Hold the agent to the task's declared scope WHILE it runs, not only\n // in the change set afterwards. The post-hoc assessment stays — it is\n // the authoritative record, because an agent can write a file it never\n // asked permission for — but a refusal in the moment is the only one\n // that prevents the write rather than reporting it.\n isPermittedCodingLocation: buildApplicationCodingTaskLocationPredicate(\n this.companionContext.saasRoot,\n task.mutationScope.allowedPathPrefixes,\n task.mutationScope.prohibitedPathPrefixes,\n ),\n onCodingSessionEvent: (event) => {\n codingSessionEventCount += 1;\n if (\n retainedCodingSessionFrames.length < RETAINED_CODING_SESSION_FRAME_LIMIT\n && RETAINED_CODING_SESSION_EVENT_KINDS.has(event.kind)\n ) {\n retainedCodingSessionFrames.push(event);\n }\n this.publishCodingSessionFrame(durableTask._id, { channel: 'event', payload: event });\n },\n // The JUDGMENT half of the interactive lane: classify each end-of-turn\n // message so the engine ladder can auto-continue a self-pause and park\n // a genuine question. The engine fails OPEN if this throws, so a\n // classifier fault degrades to \"the turn is complete\" rather than\n // hanging the run — this method may therefore throw freely.\n classifyCodingTurnEnd: (input) => this.classifyCodingTurnEnd(input),\n onCodingSessionStateChange: (state) => {\n this.publishCodingSessionFrame(durableTask._id, { channel: 'state', payload: state });\n },\n ...(this.activeRun ? { codingSessionAbortSignal: this.activeRun.abortController.signal } : {}),\n },\n );\n const codingOutput = response.output as Partial<CodingAgent_RunTaskOutput> | undefined;\n // The agent runtime publishes provider-learned facts on `executionContext`.\n codingUsage = (response.executionContext as { usage?: CodingAgent_Usage } | undefined)?.usage;\n codingDeniedPermissionCount = codingOutput?.deniedPermissionCount;\n codingPermissionDecisions = codingOutput?.permissionDecisions;\n const text = codingOutput?.finalMessage;\n agentStopReason = codingOutput?.stopReason;\n // A PARKED run stopped WITHOUT finishing to ask the operator a question.\n // Its `finalMessage` is the question and its partial edits are NOT a final\n // change set — so it must skip assessment, verification and the\n // terminal disposition entirely, and instead record an answerable,\n // non-terminal state. Handled here, before the CANCELLED/empty checks,\n // because a question is a non-empty END_TURN message that would otherwise\n // read as a completed working result.\n if (codingOutput?.suspension) {\n await this.recordParkedApplicationCodingTask({\n task,\n verificationPlans,\n durableTask,\n baseline,\n suspension: codingOutput.suspension,\n output: codingOutput,\n usage: codingUsage,\n codingSessionEventCount,\n retainedCodingSessionFrames,\n startedAtMs,\n runSession,\n runStep,\n traceBestEffort,\n });\n return;\n }\n // A CANCELLED turn is not a completed one, and its partial change set must\n // not be read as a working result. Refused here rather than downstream so\n // the disposition names the actual reason.\n if (agentStopReason === CodingAgent_StopReason.CANCELLED) {\n throw new Error('Application coding Agent turn was cancelled before it completed.');\n }\n if (typeof text !== 'string' || text.trim().length === 0) {\n throw new Error('Application coding Agent returned no final message.');\n }\n agentOutput = text;\n } catch (error) {\n runError = error;\n }\n\n let changeSet: GitChangeSetCapture | null = null;\n let captureError: unknown = null;\n try {\n changeSet = await this.gitChangeSetService.captureChangeSet(baseline);\n } catch (error) {\n captureError = error;\n }\n\n const scopeAssessment = changeSet\n ? assessApplicationCodingTaskMutationScope(changeSet, task.mutationScope.allowedPathPrefixes, task.mutationScope.prohibitedPathPrefixes)\n : null;\n // Verification is deliberately sequential. Each check has a fixed\n // semantic meaning, but several checks can still contend for the same\n // application package/cache if started together. The ordered outcomes are\n // easier to inspect and avoid turning a bounded coding task into an\n // accidental local-build fan-out.\n const shouldVerify = !runError && !captureError && scopeAssessment?.allowed === true;\n const { verification, infrastructureError: verificationInfrastructureError } = shouldVerify\n ? await this.executeVerificationPlans(verificationPlans)\n : { verification: [] as Array<{ checkRef: string; outcome: VerificationOutcome }>, infrastructureError: null as unknown };\n const failedVerification = verification.find(({ outcome }) => !outcome.success) ?? null;\n\n if (agentOutput) {\n await traceBestEffort('write-agent-output', () =>\n this.traceOperationArtifact(runSession, runStep, 'application-coding-task-agent-output.txt', agentOutput));\n }\n if (changeSet?.fullDiffText) {\n await traceBestEffort('write-change-set', () =>\n this.traceOperationArtifact(runSession, runStep, 'application-coding-task-change-set.diff', changeSet.fullDiffText));\n }\n\n const disposition = runError\n ? ApplicationCodingTaskDisposition.AGENT_EXECUTION_FAILED\n : captureError\n ? ApplicationCodingTaskDisposition.CHANGE_SET_CAPTURE_FAILED\n : !scopeAssessment?.allowed\n ? ApplicationCodingTaskDisposition.MUTATION_SCOPE_VIOLATION\n : failedVerification\n ? ApplicationCodingTaskDisposition.VERIFICATION_FAILED\n : traceabilityErrors.length > 0\n ? ApplicationCodingTaskDisposition.TRACEABILITY_FAILED\n : ApplicationCodingTaskDisposition.WORKING_RESULT_RECORDED;\n const succeeded = disposition === ApplicationCodingTaskDisposition.WORKING_RESULT_RECORDED;\n const output = {\n succeeded,\n disposition,\n durationMs: Date.now() - startedAtMs,\n agentOutputTail: agentOutput.slice(-OUTPUT_TAIL_CHARS),\n // Recorded on the durable row because it is the difference between \"the\n // agent finished\" and \"the agent stopped\": a turn that ended on\n // `max_tokens` or `refusal` leaves a partial change set that looks exactly\n // like a complete one from the diff alone.\n ...(agentStopReason ? { agentStopReason } : {}),\n ...(codingSessionEventCount > 0 ? { codingSessionEventCount } : {}),\n ...(retainedCodingSessionFrames.length > 0 ? { codingSessionFrames: retainedCodingSessionFrames } : {}),\n // #2: the run's real cost, recorded on the durable row.\n //\n // This is what the previous transport structurally could not report, and\n // it was captured by the runner and dropped here — so the budget still saw\n // nothing. `usage` is optional in every field by contract, so absence is\n // preserved as absence rather than written as zero.\n ...(codingUsage ? { usage: codingUsage } : {}),\n ...(codingDeniedPermissionCount !== undefined\n ? { deniedPermissionCount: codingDeniedPermissionCount }\n : {}),\n // WHY each permission was decided, beside how many were refused. A refusal an operator\n // cannot explain is a refusal they cannot act on — see the field's contract.\n ...(codingPermissionDecisions && codingPermissionDecisions.length > 0\n ? { permissionDecisions: codingPermissionDecisions }\n : {}),\n ...(runError ? { error: buildOutputErrorPayload(runError) } : {}),\n ...(captureError ? { changeSetCaptureError: buildOutputErrorPayload(captureError) } : {}),\n ...(verificationInfrastructureError ? { verificationInfrastructureError: buildOutputErrorPayload(verificationInfrastructureError) } : {}),\n ...(traceabilityErrors.length > 0 ? { traceabilityErrors: traceabilityErrors.map(buildOutputErrorPayload) } : {}),\n ...(scopeAssessment ? { scopeAssessment } : {}),\n verification,\n ...(changeSet ? {\n changeSetSummary: {\n baselineHeadSha: changeSet.baselineHeadSha,\n postRunHeadSha: changeSet.postRunHeadSha,\n headMovedDuringRun: changeSet.headMovedDuringRun,\n stats: changeSet.stats,\n },\n } : { changeSetSummary: null }),\n };\n\n try {\n const updatePayload = CompanionUpdateActorTaskRequestSchema.parse({\n status: succeeded ? FlowsActors_Status.COMPLETED : FlowsActors_Status.FAILED,\n output,\n ...(changeSet ? { artifacts: [buildChangeSetArtifact(durableTask._id, changeSet)] } : {}),\n });\n await this.executionsService.updateActorTask(durableTask._id, updatePayload, runSession);\n } catch (error) {\n // Do not turn a failed durable PATCH into a retry: the agent may already\n // have changed files and re-execution would duplicate an unclassified\n // effect. The PROCESSING row is deliberately visible for the explicit\n // restart-review hook, while the trace records why it was not terminal.\n this.logger.error('Failed to persist terminal application coding-task result', {\n taskId: durableTask._id,\n taskRef: task.taskRef,\n error: describeCaughtError(error),\n });\n await traceBestEffort('record-terminal-patch-failure', () => this.traceOperationFailure({\n sessionContext: runSession,\n step: runStep,\n type: 'application-coding-task-terminal-patch-failure',\n summary: `Failed to persist terminal result for application coding task ${task.taskRef}`,\n error,\n payload: output,\n }));\n return;\n }\n\n if (succeeded) {\n await traceBestEffort('record-success', () => this.traceOperationSuccess({\n sessionContext: runSession,\n step: runStep,\n type: 'application-coding-task-run-success',\n summary: `Recorded working result for application coding task ${task.taskRef}`,\n payload: output,\n }));\n return;\n }\n await traceBestEffort('record-failure', () => this.traceOperationFailure({\n sessionContext: runSession,\n step: runStep,\n type: 'application-coding-task-run-failure',\n summary: `Application coding task ${task.taskRef} requires follow-up`,\n error: runError ?? captureError ?? verificationInfrastructureError ?? traceabilityErrors[0] ?? new Error(`Application coding task disposition: ${disposition}`),\n payload: output,\n }));\n }\n\n // ================================================================\n // Interactive lane — classifier, live relay, park & resume\n // ================================================================\n\n /**\n * Classify a coding agent's end-of-turn message through the dedicated\n * structured classifier agent. Throws on any fault; the ENGINE ladder wraps\n * that into `CLASSIFIER_UNAVAILABLE` and settles, so this never has to invent\n * a safe default of its own.\n */\n private async classifyCodingTurnEnd(input: {\n readonly finalMessage: string;\n readonly turnIndex: number;\n }): Promise<CodingAgent_EndOfTurnClassification> {\n const prompt = [\n 'A coding agent ended its turn with the message below. Classify what the message means so an '\n + 'autonomous runner can decide whether to continue automatically, or to surface a question to '\n + 'the operator.',\n '',\n '# Agent end-of-turn message',\n input.finalMessage,\n ].join('\\n');\n const invocation: FlowsActors_Agent_Invocation<any, any> = {\n agentRef: APPLICATION_CODING_TURN_CLASSIFIER_AGENT_REF,\n initiator: {},\n invocationContext: [],\n input: { prompt, schema: CodingTurnEndClassificationOutputSchema },\n output: { object: {} },\n executionContext: {},\n artifactBindings: [],\n };\n const response = await this.agentsService.invokeAgent(invocation);\n const raw = (response.output as { object?: unknown } | undefined)?.object;\n const parsed = CodingTurnEndClassificationOutputSchema.safeParse(raw);\n if (!parsed.success) {\n // A malformed classifier answer is a classifier fault: let the ladder fail\n // open rather than guess which situation the model meant.\n throw new Error('Coding turn-end classifier returned an unparseable result.');\n }\n return parsed.data.classification;\n }\n\n /** Fan one live frame out to a task's SSE subscribers. Best-effort, never throws into the run. */\n private publishCodingSessionFrame(taskId: string, frame: CodingSessionLiveFrame): void {\n const listeners = this.codingSessionSubscribers.get(taskId);\n if (!listeners) return;\n for (const listener of listeners) {\n try {\n listener(frame);\n } catch {\n // A subscriber must never be able to fail the run it observes.\n }\n }\n }\n\n /**\n * Subscribe to a task's live coding frames. Returns an unsubscribe function.\n *\n * Frames flow only while a run is ACTIVE for that task; a subscriber that\n * attaches after the run parked or finished simply receives nothing further,\n * which is why the SSE endpoint sends the current pending question up front.\n */\n public subscribeToCodingSession(taskId: string, listener: (frame: CodingSessionLiveFrame) => void): () => void {\n let listeners = this.codingSessionSubscribers.get(taskId);\n if (!listeners) {\n listeners = new Set();\n this.codingSessionSubscribers.set(taskId, listeners);\n }\n listeners.add(listener);\n return () => {\n const set = this.codingSessionSubscribers.get(taskId);\n if (!set) return;\n set.delete(listener);\n if (set.size === 0) this.codingSessionSubscribers.delete(taskId);\n };\n }\n\n /** The questions currently awaiting an operator answer, for status/UX. */\n public listPendingCodingQuestions(): Array<{ taskId: string; taskRef: string; question: string; parkedAt: string; resumable: boolean }> {\n return [...this.parkedCodingSessions.values()].map((parked) => ({\n taskId: parked.durableTask._id,\n taskRef: parked.task.taskRef,\n question: parked.suspension.question,\n parkedAt: parked.parkedAt,\n resumable: parked.suspension.resumable,\n }));\n }\n\n /**\n * Record a run that parked on a question: persist the non-terminal durable row\n * (status PROCESSING, disposition AWAITING_OPERATOR_INPUT, question on the\n * output) and retain the answerable state in memory for the resume door.\n *\n * Deliberately skips change-set assessment and verification: a parked run's\n * edits are partial by definition, and assessing them as a final change set is\n * exactly the \"read a suspended turn as complete\" mistake the suspension field\n * exists to prevent.\n */\n private async recordParkedApplicationCodingTask(params: {\n task: ApplicationCodingTaskContract;\n verificationPlans: readonly ApplicationCodingTaskVerificationPlan[];\n durableTask: DispatchedTaskRow;\n baseline: GitWorktreeSnapshot;\n suspension: CodingAgent_SessionSuspension;\n output: Partial<CodingAgent_RunTaskOutput>;\n usage: CodingAgent_Usage | undefined;\n codingSessionEventCount: number;\n retainedCodingSessionFrames: Array<{ readonly kind: string; readonly payload: unknown }>;\n startedAtMs: number;\n runSession: CompanionExecutionSessionContext | undefined;\n runStep: ReturnType<CompanionTraceabilityService['createStep']> | undefined;\n traceBestEffort: (operation: string, write: () => Promise<void>) => Promise<void>;\n }): Promise<void> {\n const { task, durableTask, baseline, suspension, output, verificationPlans } = params;\n\n this.parkedCodingSessions.set(durableTask._id, {\n durableTask,\n task,\n verificationPlans,\n baseline,\n suspension,\n parkedAt: new Date().toISOString(),\n });\n\n const durableOutput = {\n succeeded: false,\n disposition: ApplicationCodingTaskDisposition.AWAITING_OPERATOR_INPUT,\n durationMs: Date.now() - params.startedAtMs,\n // The question the operator must answer, front and centre.\n pendingQuestion: suspension.question,\n suspension,\n agentOutputTail: (output.finalMessage ?? '').slice(-OUTPUT_TAIL_CHARS),\n ...(output.stopReason ? { agentStopReason: output.stopReason } : {}),\n ...(output.turnCount ? { turnCount: output.turnCount } : {}),\n ...(output.continuations && output.continuations.length > 0 ? { continuations: output.continuations } : {}),\n ...(params.codingSessionEventCount > 0 ? { codingSessionEventCount: params.codingSessionEventCount } : {}),\n ...(params.retainedCodingSessionFrames.length > 0 ? { codingSessionFrames: params.retainedCodingSessionFrames } : {}),\n ...(params.usage ? { usage: params.usage } : {}),\n ...(output.deniedPermissionCount !== undefined ? { deniedPermissionCount: output.deniedPermissionCount } : {}),\n ...(output.permissionDecisions && output.permissionDecisions.length > 0 ? { permissionDecisions: output.permissionDecisions } : {}),\n };\n\n // Status stays PROCESSING: the task is genuinely still in flight, waiting on\n // the operator. It is not COMPLETED (nothing was accepted) and not FAILED\n // (nothing went wrong) — the disposition carries the real state.\n const updatePayload = CompanionUpdateActorTaskRequestSchema.parse({\n status: FlowsActors_Status.PROCESSING,\n output: durableOutput,\n });\n await this.executionsService.updateActorTask(durableTask._id, updatePayload, params.runSession);\n\n await params.traceBestEffort('record-awaiting-input', () => this.traceOperationStart({\n sessionContext: params.runSession,\n step: params.runStep,\n type: 'application-coding-task-awaiting-input',\n summary: `Application coding task ${task.taskRef} is awaiting an operator answer`,\n payload: { taskId: durableTask._id, question: suspension.question, resumable: suspension.resumable },\n }));\n }\n\n /** The in-process answerable state for a parked task, if this process is the one that parked it. */\n public getParkedCodingSessionState(taskId: string): ParkedCodingSessionState | null {\n return this.parkedCodingSessions.get(taskId) ?? null;\n }\n\n /**\n * Load the DURABLE facts needed to RECONSTRUCT a parked task's answerable state\n * after the in-process map has lost it (a companion restart).\n *\n * Returns the build-plan `taskRef` and the persisted `suspension` — enough for\n * the build-dispatch layer to re-compose the task contract and rebuild a\n * {@link ParkedCodingSessionState}. `null` when the row is not a parked coding\n * task (wrong actor, no suspension, or not found).\n */\n public async loadPersistedParkedCodingTask(\n taskId: string,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<{ taskRef: string; suspension: CodingAgent_SessionSuspension; durableTask: DispatchedTaskRow } | null> {\n let durableTask: DispatchedTaskRow;\n try {\n durableTask = await this.executionsService.getActorTask(taskId, sessionContext) as DispatchedTaskRow;\n } catch {\n return null;\n }\n const row = durableTask as { actors?: { actorRef?: string }; input?: unknown; output?: unknown };\n if (row.actors?.actorRef !== APPLICATION_CODING_AGENT_REF) return null;\n const taskRef = isRecordValue(row.input) && typeof row.input.taskRef === 'string' ? row.input.taskRef : null;\n const suspensionRaw = isRecordValue(row.output) ? row.output.suspension : undefined;\n const parsedSuspension = CodingAgent_SessionSuspensionSchema.safeParse(suspensionRaw);\n if (!taskRef || !parsedSuspension.success) return null;\n return { taskRef, suspension: parsedSuspension.data, durableTask };\n }\n\n /**\n * Answer a parked coding task's question and resume the SAME agent session.\n *\n * The IN-PROCESS door: it answers a task THIS process parked. For a task whose\n * in-process state was lost to a restart, the caller reconstructs a\n * {@link ParkedCodingSessionState} (from the build plan) and uses\n * {@link resumeParkedCodingTask} directly.\n */\n public async respondToApplicationCodingTaskQuestion(\n taskId: string,\n answer: string,\n ): Promise<ApplicationCodingTaskRunAdmission> {\n // A missing answer is a VALIDATION 400 regardless of whether a task is parked\n // — it is a malformed request, not a state conflict.\n this.admitTypedInput(() => {\n if (answer.trim().length === 0) throw new Error('empty answer');\n return answer;\n }, 'An answer is required to resume a parked coding task.');\n const parked = this.parkedCodingSessions.get(taskId);\n if (!parked) {\n throw this.buildDispatchConflictError(\n `No coding task is awaiting an answer under id ${taskId} in this process. `\n + 'A companion restart drops in-flight answerable state; re-dispatch the task instead.',\n );\n }\n return this.resumeParkedCodingTask(parked, answer);\n }\n\n /**\n * Run a resume against an EXPLICIT parked state — from the in-process map or\n * reconstructed from the build plan after a restart.\n *\n * Runs under the worktree mutation lock exactly like a fresh dispatch (a resume\n * mutates the same worktree) and re-enters the turn ladder through\n * `session/load`, so the agent continues with its full context. The mutation\n * scope and verification plan are the parked contract's; a resume is held to the\n * same bounds as the first run.\n */\n public async resumeParkedCodingTask(\n parked: ParkedCodingSessionState,\n answer: string,\n ): Promise<ApplicationCodingTaskRunAdmission> {\n const trimmedAnswer = this.admitTypedInput(() => {\n const value = answer.trim();\n if (value.length === 0) throw new Error('empty answer');\n return value;\n }, 'An answer is required to resume a parked coding task.');\n const taskId = parked.durableTask._id;\n if (!parked.suspension.resumable) {\n throw this.buildDispatchConflictError(\n `Coding task ${taskId} parked on a question, but its agent does not support session resume, `\n + 'so the answer cannot be delivered to the same session. Re-dispatch the task with the answer folded into the objective.',\n );\n }\n if (this.activeRun) {\n throw this.buildDispatchConflictError(\n `A coding-agent run is already active (task ${this.activeRun.taskId}). Answers are serialized behind the same worktree lock.`,\n );\n }\n\n // Taken out of the answerable set for the duration of the resume; a resume\n // that parks again re-registers it through the same suspension branch.\n this.parkedCodingSessions.delete(taskId);\n\n const admission = createDeferred<ApplicationCodingTaskRunAdmission>();\n const resumeRun = withDedicatedFileLock(\n this.getWorkspaceMutationLockPath(),\n async () => {\n this.activeRun = { taskId, startedAt: new Date().toISOString(), abortController: new AbortController() };\n const settlement = createDeferred<void>();\n this.applicationCodingTaskSettlements.set(taskId, { promise: settlement.promise, resolve: () => settlement.resolve(undefined) });\n admission.resolve({\n taskId,\n status: FlowsActors_Status.PROCESSING,\n taskRef: parked.task.taskRef,\n baselineHeadSha: parked.baseline.headSha,\n baselineDirtyFileCount: Object.keys(parked.baseline.files).length,\n });\n try {\n await this.executeApplicationCodingTask(\n parked.task,\n renderApplicationCodingTaskAgentPrompt(parked.task),\n parked.verificationPlans,\n parked.durableTask,\n parked.baseline,\n { continuationOfSessionId: parked.suspension.sessionId, answerPrompt: trimmedAnswer },\n );\n } finally {\n this.activeRun = null;\n this.applicationCodingTaskSettlements.get(taskId)?.resolve();\n }\n },\n { retries: { retries: 0 } },\n );\n resumeRun.catch((error: unknown) => {\n admission.reject(this.mapLockError(error));\n this.logDebug('Application coding-task resume run terminated with error', {\n taskId,\n error: describeCaughtError(error),\n });\n });\n\n return admission.promise;\n }\n\n private buildApplicationCodingTaskTraceSummary(task: ApplicationCodingTaskContract): Record<string, unknown> {\n return {\n taskRef: task.taskRef,\n objectiveRef: task.objectiveRef,\n candidateRef: task.candidateRef,\n mutationScope: task.mutationScope,\n contextPlanRef: task.contextPlan.planRef,\n selectedSourceRefs: task.contextSelection.selectedSources.map((source) => source.sourceRef),\n verificationRef: task.verificationIntent.verificationRef,\n requiredChecks: task.verificationIntent.requiredChecks,\n installedSkillRefs: task.installedSkillRefs,\n };\n }\n\n // ================================================================\n // Verification hook (P-29c — enum vocabulary, never a command string)\n // ================================================================\n\n private buildVerificationPlan(kind: VerificationKind, requestedPath?: string): VerificationPlan {\n if (kind === VerificationKind.VITEST_PATH) {\n const sanitized = this.sanitizeRelativePath(requestedPath ?? '');\n const absoluteTestPath = join(this.companionContext.saasRoot, sanitized);\n const packageDir = this.findNearestPackageDir(dirname(absoluteTestPath));\n return {\n kind,\n path: sanitized,\n command: 'pnpm',\n args: ['exec', 'vitest', 'run', relative(packageDir, absoluteTestPath)],\n cwd: packageDir,\n };\n }\n\n // TYPECHECK — optional path points at a workspace package directory.\n const sanitized = requestedPath ? this.sanitizeRelativePath(requestedPath) : null;\n return {\n kind,\n path: sanitized,\n command: 'pnpm',\n args: ['exec', 'tsc', '--noEmit'],\n cwd: sanitized ? join(this.companionContext.saasRoot, sanitized) : this.companionContext.saasRoot,\n };\n }\n\n /**\n * The FK-resolution sweep, sourced from the `resources-registry` introspection\n * behavior — a FRESH subprocess import of the app's shared-lib, never the\n * companion's boot-time cache, so it judges exactly the bytes the mutation\n * left on disk. Fails the check when any `.isForeignKey()` field has no\n * registered relationship edge: invisible to every typecheck in the plan and\n * to the backend boot, fatal to the app's frontend at first page load\n * (`frontend_fk_resolution_failed` — wonder-crm, 2026-08-27).\n */\n private async runForeignKeyResolutionVerification(): Promise<VerificationOutcome> {\n const backendServiceKey = Object.entries(this.companionContext.servicesByKey)\n .find(([, service]) => !service.frontendType)?.[0];\n if (!backendServiceKey) {\n throw new Error('No backend service is available to run the frontend-fk-resolution verification.');\n }\n const result = await this.introspectionService.requestInfo({\n serviceKey: backendServiceKey,\n behavior: 'resources-registry',\n });\n if (!result.success) {\n throw new Error(`resources-registry introspection failed: ${JSON.stringify(result)}`);\n }\n const unresolved = (result.data as { unresolvableForeignKeyFields?: Array<{ resourceType: string; fieldName: string }> })\n .unresolvableForeignKeyFields ?? [];\n const success = unresolved.length === 0;\n return {\n kind: VerificationKind.FRONTEND_FK_RESOLUTION,\n path: null,\n success,\n message: success\n ? 'every isForeignKey() field resolves through a registered relationship'\n : `${unresolved.length} FK field(s) cannot be resolved to a resource type: `\n + unresolved.map(({ resourceType, fieldName }) => `${resourceType}.${fieldName}`).join(', ')\n + ' — declare a relationship with the corresponding foreignKeyField.',\n stdoutTail: '',\n stderrTail: '',\n };\n }\n\n /**\n * The settings-rail content sweep — the SHELL_PLACEMENT counterpart of the FK sweep,\n * and it exists for the same reason: the defect it catches is invisible to a typecheck.\n *\n * A placement naming a `destinationRef` the engine catalog does not ship is not a type\n * error. `resolveSettingsHubConfig` DROPS it, and the section silently never renders —\n * so a coding task that typo'd a ref passes `check:app-typecheck`, reports verified, and\n * leaves the application missing a settings section nobody is told about.\n *\n * WARNINGS do not fail the check. Only errors do: the verifier reports both severities,\n * and failing a coding task on an advisory would train the lane to ignore its own gate.\n */\n private async runSettingsPlacementContentVerification(): Promise<VerificationOutcome> {\n // Mirrors the FK sweep's resolution, on the other side of the same predicate: that\n // one wants a backend service, this one a FRONTEND service, because the settings rail\n // is authored in the frontend workspace and only that subprocess can import it.\n const frontendServiceKey = Object.entries(this.companionContext.servicesByKey)\n .find(([, service]) => service.frontendType)?.[0];\n if (!frontendServiceKey) {\n throw new Error('No frontend service is available to run the settings-placement-content verification.');\n }\n const result = await this.introspectionService.requestInfo({\n serviceKey: frontendServiceKey,\n behavior: 'settings-placement-content',\n });\n if (!result.success) {\n throw new Error(`settings-placement-content introspection failed: ${JSON.stringify(result)}`);\n }\n const data = result.data as {\n authored?: boolean;\n errors?: Array<{ severity: string; code: string; message: string }>;\n };\n const blocking = (data.errors ?? []).filter((error) => error.severity !== 'warning');\n const success = blocking.length === 0;\n return {\n kind: VerificationKind.SETTINGS_PLACEMENT_CONTENT,\n path: null,\n success,\n message: success\n ? (data.authored === false\n // Not a silent pass: an application with no authored rail has nothing to\n // verify, and saying so is the difference between \"checked and clean\" and\n // \"there was nothing to check\".\n ? 'no settings rail is authored — nothing to verify'\n : 'every authored placement names a destination the engine ships')\n : `${blocking.length} settings-placement error(s): `\n + blocking.map((error) => `${error.code}: ${error.message}`).join(' | '),\n stdoutTail: '',\n stderrTail: '',\n };\n }\n\n /**\n * Run a resolved verification plan set and return one outcome per check.\n *\n * Extracted from the coding-task dispatch so the SAME executor serves a second caller: the\n * `DETERMINISTIC_CLI` playbook tier, which verifies an already-built application and dispatches no\n * agent (issue #147). The alternative was a second loop that re-derived which kinds branch away\n * from the argv path — and the two would drift the first time a `VerificationKind` was added,\n * silently, because a missed kind falls through to a typecheck that passes.\n *\n * A thrown error is an INFRASTRUCTURE failure, not a failing check: the subprocess could not be\n * run at all. It is recorded as a failed outcome so the caller sees which check was affected, and\n * surfaced separately so a caller can tell \"the application is broken\" from \"we could not ask\".\n */\n private async executeVerificationPlans(\n plans: readonly ApplicationCodingTaskVerificationPlan[],\n ): Promise<{\n verification: Array<{ checkRef: string; outcome: VerificationOutcome }>;\n infrastructureError: unknown;\n }> {\n const verification: Array<{ checkRef: string; outcome: VerificationOutcome }> = [];\n let infrastructureError: unknown = null;\n for (const plan of plans) {\n try {\n verification.push({\n checkRef: plan.checkRef,\n // The FK-resolution check is not a CLI command: it runs in the companion's\n // introspection subprocess (fresh working-tree import), so it branches before\n // the argv-plan path.\n outcome: plan.kind === VerificationKind.FRONTEND_FK_RESOLUTION\n ? await this.runForeignKeyResolutionVerification()\n : plan.kind === VerificationKind.SETTINGS_PLACEMENT_CONTENT\n ? await this.runSettingsPlacementContentVerification()\n : await this.runVerification(this.buildVerificationPlan(plan.kind, plan.path ?? undefined)),\n });\n } catch (error) {\n infrastructureError ??= error;\n verification.push({\n checkRef: plan.checkRef,\n outcome: {\n kind: plan.kind,\n path: plan.path,\n success: false,\n message: describeCaughtError(error),\n stdoutTail: '',\n stderrTail: '',\n },\n });\n }\n }\n return { verification, infrastructureError };\n }\n\n /**\n * Run named verification checks against the application, outside any agent dispatch.\n *\n * The public door for the `DETERMINISTIC_CLI` tier. Check refs resolve through the same closed\n * `APPLICATION_CODING_TASK_VERIFICATION_CATALOG` a coding task uses, so an unknown ref is refused\n * here rather than becoming an unrun check that reports success by absence.\n *\n * Deliberately takes NO worktree lock and captures NO change set: this reads the application, and\n * pretending otherwise would serialize verification against the single-flight coding lane for no\n * reason.\n */\n public async runApplicationVerificationChecks(\n checkRefs: readonly string[],\n ): Promise<{\n verification: Array<{ checkRef: string; outcome: VerificationOutcome }>;\n infrastructureError: unknown;\n }> {\n return this.executeVerificationPlans(resolveApplicationCodingTaskVerificationPlans(checkRefs));\n }\n\n private async runVerification(plan: VerificationPlan): Promise<VerificationOutcome> {\n try {\n const result = await executeBoundedSubprocess({\n command: plan.command,\n args: plan.args,\n cwd: plan.cwd,\n env: buildVerificationEnv(),\n timeoutMs: VERIFICATION_TIMEOUT_MS,\n maxCapturedBytes: VERIFICATION_MAX_CAPTURED_BYTES,\n });\n return {\n kind: plan.kind,\n path: plan.path,\n success: true,\n message: `${plan.command} ${plan.args.join(' ')} passed`,\n stdoutTail: result.stdout.slice(-OUTPUT_TAIL_CHARS),\n stderrTail: result.stderr.slice(-OUTPUT_TAIL_CHARS),\n };\n } catch (error) {\n const details = (error as { details?: { stdout?: string; stderr?: string } }).details;\n return {\n kind: plan.kind,\n path: plan.path,\n success: false,\n message: describeCaughtError(error),\n stdoutTail: (details?.stdout ?? '').slice(-OUTPUT_TAIL_CHARS),\n stderrTail: (details?.stderr ?? '').slice(-OUTPUT_TAIL_CHARS),\n };\n }\n }\n\n /**\n * Run one admission-time validation and convert ANY refusal into a typed\n * VALIDATION error, preserving the original message as context.\n *\n * Deliberately a wrapper rather than N rewritten throw sites: the pure\n * resolver in the models layer has no error builder and should not grow one,\n * and a future admission check gets the same classification by being placed\n * here rather than by remembering to.\n */\n private admitTypedInput<T>(validate: () => T, message: string): T {\n try {\n return validate();\n } catch (error) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message,\n validationError: describeCaughtError(error),\n },\n });\n }\n }\n\n /**\n * Sanitize an app-root-relative path from the wire: rejects absolute\n * paths, `..` escapes, backslashes, NUL bytes, and flag-lookalikes\n * (leading `-` would be parsed as an argv flag by the fixed commands).\n */\n private sanitizeRelativePath(requestedPath: string): string {\n const candidate = requestedPath.trim();\n const reject = (reason: string): never => {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message: `Invalid verification path: ${reason}`,\n requestedPath,\n },\n });\n };\n\n if (!candidate) reject('path is empty');\n if (candidate.includes('\\0')) reject('path contains a NUL byte');\n if (candidate.includes('\\\\')) reject('use forward slashes');\n if (isAbsolute(candidate)) reject('path must be relative to the application root');\n if (candidate.startsWith('-')) reject('path must not start with a dash');\n const normalized = normalize(candidate);\n if (normalized.split(sep).includes('..')) reject('path must not escape the application root');\n\n const absolute = join(this.companionContext.saasRoot, normalized);\n const relativeFromRoot = relative(this.companionContext.saasRoot, absolute);\n if (relativeFromRoot.startsWith('..') || isAbsolute(relativeFromRoot)) {\n reject('path resolves outside the application root');\n }\n return normalized;\n }\n\n /** Nearest ancestor dir (within the app root) holding a package.json. */\n private findNearestPackageDir(startDir: string): string {\n let current = startDir;\n const root = this.companionContext.saasRoot;\n while (current.startsWith(root)) {\n if (existsSync(join(current, 'package.json'))) {\n return current;\n }\n const parent = dirname(current);\n if (parent === current) break;\n current = parent;\n }\n return root;\n }\n\n // ================================================================\n // Error + traceability helpers (service-owned wrappers, P-13 pattern)\n // ================================================================\n\n private buildDispatchConflictError(message: string): unknown {\n return this.errorBuilder.buildError(ErrorType.CONFLICT, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFLICT,\n context: { message },\n });\n }\n\n /** Map proper-lockfile ELOCKED contention onto the 409 vocabulary. */\n private mapLockError(error: unknown): unknown {\n if ((error as { code?: string })?.code === 'ELOCKED') {\n return this.buildDispatchConflictError(\n 'The workspace-mutation lock is held by another process (companion run or CLI). '\n + 'Dispatch is single-flight across processes (P-20); retry after the active run completes. '\n + 'If you are a dispatched coding-agent run: dispatching from a dispatched run is forbidden (P-35).',\n );\n }\n return error;\n }\n\n private createOperationTraceStep(\n sessionContext: CompanionExecutionSessionContext | undefined,\n label: string,\n ) {\n return sessionContext\n ? this.traceabilityService.createStep(sessionContext, {\n kind: 'coding-agent-dispatch',\n label,\n })\n : undefined;\n }\n\n private async traceOperationStart(input: {\n sessionContext?: CompanionExecutionSessionContext;\n step?: ReturnType<CompanionTraceabilityService['createStep']>;\n type: string;\n summary: string;\n payload?: unknown;\n artifactFileName?: string;\n artifactContent?: unknown;\n }): Promise<void> {\n if (!input.sessionContext) return;\n\n await this.traceabilityService.traceEvent({\n session: input.sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG,\n type: input.type,\n summary: input.summary,\n ...(input.payload !== undefined ? { payload: input.payload } : {}),\n ...(input.step ? { step: input.step } : {}),\n });\n if (input.artifactFileName && input.artifactContent !== undefined) {\n await this.traceabilityService.writeArtifact({\n session: input.sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG_VERBOSE,\n fileName: input.artifactFileName,\n content: input.artifactContent,\n ...(input.step ? { step: input.step } : {}),\n });\n }\n }\n\n private async traceOperationSuccess(input: {\n sessionContext?: CompanionExecutionSessionContext;\n step?: ReturnType<CompanionTraceabilityService['createStep']>;\n type: string;\n summary: string;\n payload?: unknown;\n artifactFileName?: string;\n artifactContent?: unknown;\n }): Promise<void> {\n if (!input.sessionContext) return;\n\n if (input.artifactFileName && input.artifactContent !== undefined) {\n await this.traceabilityService.writeArtifact({\n session: input.sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG_VERBOSE,\n fileName: input.artifactFileName,\n content: input.artifactContent,\n ...(input.step ? { step: input.step } : {}),\n });\n }\n await this.traceabilityService.traceEvent({\n session: input.sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG,\n type: input.type,\n summary: input.summary,\n ...(input.payload !== undefined ? { payload: input.payload } : {}),\n ...(input.step ? { step: input.step } : {}),\n });\n }\n\n private async traceOperationFailure(input: {\n sessionContext?: CompanionExecutionSessionContext;\n step?: ReturnType<CompanionTraceabilityService['createStep']>;\n type: string;\n summary: string;\n error: unknown;\n payload?: unknown;\n }): Promise<void> {\n if (!input.sessionContext) return;\n\n await this.traceabilityService.traceEvent({\n session: input.sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG,\n type: input.type,\n summary: input.summary,\n payload: {\n ...(input.payload && typeof input.payload === 'object'\n ? input.payload as Record<string, unknown>\n : { input: input.payload }),\n error: buildOutputErrorPayload(input.error),\n },\n ...(input.step ? { step: input.step } : {}),\n });\n }\n\n private async traceOperationArtifact(\n sessionContext: CompanionExecutionSessionContext | undefined,\n step: ReturnType<CompanionTraceabilityService['createStep']> | undefined,\n fileName: string,\n content: unknown,\n ): Promise<void> {\n if (!sessionContext) return;\n await this.traceabilityService.writeArtifact({\n session: sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG_VERBOSE,\n fileName,\n content,\n ...(step ? { step } : {}),\n });\n }\n}\n\ninterface VerificationPlan {\n kind: VerificationKind;\n path: string | null;\n command: string;\n args: string[];\n cwd: string;\n}\n\n/**\n * Change-set artifact persisted on the task row (P-19: file list + stats\n * + head SHAs + attribution classes). `fullDiffText` is deliberately\n * stripped — the raw diff lives in the traceability artifact only.\n *\n * Persisted as `FlowsActors_IO_PartKind.STRUCTURED` with the capture in\n * `content.data`. History: on 2026-07-03 this was temporarily JSON-encoded\n * into a TEXT artifact because the zod-to-mongoose converter flattened\n * nested discriminated unions (`artifacts[]` on the task row) onto their\n * FIRST variant, making `content.text` a required Mongoose path for every\n * artifact. The converter now merges nested union variants into an\n * all-optional superset schema, so the natural STRUCTURED shape persists\n * again (requires a saas-backend-lib dist carrying that fix).\n */\nfunction buildChangeSetArtifact(taskId: string, changeSet: GitChangeSetCapture): ArtifactInstance {\n const { fullDiffText: _fullDiffText, ...structuredCapture } = changeSet;\n return {\n ref: `coding-agent-change-set-${taskId}`,\n type: FlowsActors_IO_PartKind.STRUCTURED,\n name: 'coding-agent-change-set',\n description: 'Read-only git change-set capture with per-file attribution (P-19)',\n origin: { taskId },\n content: { data: structuredCapture },\n createdAt: new Date().toISOString(),\n };\n}\n\n/** Same minimal allowlist the CLI spawn uses (P-18). */\nfunction buildVerificationEnv(): NodeJS.ProcessEnv {\n // Same minimal identity allowlist the CLI spawn uses (P-18) — incl.\n // USER/LOGNAME so a verification hook that shells out to per-user\n // tooling behaves like the agent run. Kept in lockstep with\n // `ClaudeCliCompanionService`'s allowlist.\n const env: NodeJS.ProcessEnv = {};\n for (const key of ['PATH', 'HOME', 'USER', 'LOGNAME', 'SHELL', 'TERM']) {\n const value = process.env[key];\n if (value !== undefined) env[key] = value;\n }\n return env;\n}\n\nfunction buildOutputErrorPayload(error: unknown): unknown {\n if (isWildoBackendError(error)) return error;\n if (error instanceof Error) {\n return {\n message: error.message,\n name: error.name,\n ...(error.stack ? { stack: error.stack } : {}),\n };\n }\n return { message: String(error) };\n}\n\nfunction createDeferred<T>(): {\n promise: Promise<T>;\n resolve: (value: T) => void;\n reject: (error: unknown) => void;\n} {\n let settled = false;\n let resolveFn!: (value: T) => void;\n let rejectFn!: (error: unknown) => void;\n const promise = new Promise<T>((resolve, reject) => {\n resolveFn = resolve;\n rejectFn = reject;\n });\n return {\n promise,\n resolve: (value) => {\n if (settled) return;\n settled = true;\n resolveFn(value);\n },\n reject: (error) => {\n if (settled) return;\n settled = true;\n rejectFn(error);\n },\n };\n}\n"]}
1
+ {"version":3,"file":"coding-agent-dispatch.companion.service.js","sourceRoot":"","sources":["../../../../src/claude-cli/services/coding-agent-dispatch.companion.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;;;;;;;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEnD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,aAAa,EACb,kBAAkB,EAClB,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,iBAAiB,EAEjB,2BAA2B,EAC3B,SAAS,EACT,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,GAGpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAKL,mCAAmC,EACnC,sBAAsB,GAIvB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,mCAAmC,GAEpC,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EACL,4BAA4B,IAAI,gCAAgC,EAChE,qBAAqB,GACtB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,sCAAsC,EAAE,MAAM,gCAAgC,CAAC;AACxF,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;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E,MAAM,EAAE,EAAE;QACjD,SAAS,GAAG,OAAO,CAAC;QACpB,QAAQ,GAAG,MAAM,CAAC;IACpB,CAAC,CAAC,CAAC;IACH,OAAO;QACL,OAAO;QACP,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YACjB,IAAI,OAAO;gBAAE,OAAO;YACpB,OAAO,GAAG,IAAI,CAAC;YACf,SAAS,CAAC,KAAK,CAAC,CAAC;QACnB,CAAC;QACD,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;YAChB,IAAI,OAAO;gBAAE,OAAO;YACpB,OAAO,GAAG,IAAI,CAAC;YACf,QAAQ,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Application coding-task host — the typed Flows/Actors coding path.\n *\n * `runApplicationCodingTask` admits one typed `ApplicationCodingTaskContract`\n * (the episode runtime's coding revision owner is the caller), renders its\n * prompt from the sealed contract, creates an `Actors_Task` row, spawns the\n * Claude CLI in the background against the application worktree, captures\n * a read-only git change set with per-file attribution, runs the contract's\n * registered verification checks, then PATCHes the task with status/output/\n * artifacts. One admission never spans the multi-minute run (P-16) —\n * callers await the settlement or poll `/tasks/actors/:taskId`. The raw\n * `POST /coding-agent/dispatch` endpoint (caller-composed prompt) was\n * deleted at the first-activation hard cut.\n *\n * # Locking & recursion cap (P-20 / P-19b / P-35)\n *\n * Runs are single-flight, serialized by a cross-process lock on the\n * dedicated target `<saasRoot>/.wildo-saas/state/workspace-mutation.lock`\n * (`withDedicatedFileLock` from `@wildo-ai/platform-config-lib`,\n * proper-lockfile pattern — an in-memory mutex alone is forbidden because\n * the CLI mutates the same worktree from other processes). An in-memory\n * flag fronts the lock for fast 409s. The lock is held for the WHOLE run.\n *\n * The P-35 recursion cap falls out structurally: a dispatched run that\n * calls dispatch (it has shell access and can read the machine-local\n * token) always finds the lock held by ITS OWN run and is rejected 409 —\n * a dispatched run can never dispatch. Deliberately, the lock does NOT\n * gate Paul's parallel sessions (P-19b): CLAUDE.md forbids session\n * coordination; per-file attribution is the compensation, not exclusion.\n *\n * # Traceability (P-21)\n *\n * L2 runs dispatch through `AgentsBackendService.invokeAgent`, so they DO\n * reach the engine `AgentCallTraceSink` (on success and on failure, gated by\n * the agent-traceability policy and silent when no sink is bound) and they DO\n * run through the provider's Bottleneck limiter, which `executeAgentViaACP`\n * schedules the session on. The pre-ACP direct claude-cli lane bypassed both;\n * that is history, not the current shape. Two things still do not come free:\n * a NONE policy level or an unbound sink means no engine trace at all, so this\n * service also owns its companion-traceability events (DEBUG) and artifacts\n * (DEBUG_VERBOSE). The background phase runs under an INTERNAL trace session\n * (`createInternalSession`) because the HTTP request session ends at the\n * 202-style response.\n *\n * # Run limits (P-18)\n *\n * Defaults 30 min / 10 MiB; request-overridable up to hard caps\n * 60 min / 32 MiB. The byte cap REJECTS (kills the run), it does not\n * truncate. Args stay `--print` + `--model` (no extraArgs field), prompt\n * on stdin, env = `{ PATH, HOME, SHELL, TERM }` (composed inside\n * the ACP session runner).\n */\n\nimport { isAbsolute, join, normalize, relative, sep, dirname } from 'node:path';\nimport { existsSync, realpathSync } from 'node:fs';\n\nimport { inject, injectable } from 'inversify';\nimport {\n AgentsBackendService,\n ErrorBuilderBackendService,\n LoggerService,\n SAAS_SERVICE_TYPES,\n executeBoundedSubprocess,\n describeCaughtError,\n} from '@wildo-ai/saas-backend-lib';\nimport {\n Actor_Task_Topics,\n type AgentTraceContext,\n ErrorCustomMessageReference,\n ErrorType,\n FlowsActors_IO_PartKind,\n FlowsActors_Status,\n isWildoBackendError,\n type ArtifactInstance,\n type FlowsActors_Agent_Invocation,\n} from '@wildo-ai/saas-models';\nimport {\n CodingAgent_EndOfTurnClassification,\n CodingAgent_OperationContext_BaseSchema,\n CodingAgent_RunTaskInputSchema,\n CodingAgent_RunTaskOutputSchema,\n CodingAgent_SessionSuspensionSchema,\n CodingAgent_StopReason,\n type CodingAgent_RunTaskOutput,\n type CodingAgent_SessionSuspension,\n type CodingAgent_Usage,\n} from '@wildo-ai/external-connectors-models';\nimport {\n ApplicationCodingTaskContractSchema,\n type ApplicationCodingTaskContract,\n} from '@wildo-ai/saas-specifications/application-creation';\nimport {\n getWorkspaceMutationLockPath as resolveWorkspaceMutationLockPath,\n withDedicatedFileLock,\n} from '@wildo-ai/platform-config-lib';\n\nimport { sanitizeWorkbenchCreationPlaneIdentity } from '@wildo-ai/platform-core-shared';\nimport { COMPANION_SERVICE_TYPES } from '../../core/inject/models/service-types';\nimport type { CompanionContext } from '../../core/context/companion-context';\nimport type {\n CompanionExecutionSessionContext,\n} from '../../core/traceability/companion-traceability.models';\nimport { CompanionTraceabilityLevel, CompanionTraceAliasKind } from '../../core/traceability/companion-traceability.models';\nimport { CompanionTraceabilityService } from '../../core/traceability/companion-traceability.service';\nimport { CompanionIntrospectionService } from '../../core/introspection/services/companion-introspection.companion.service';\nimport { CompanionExecutionsCompanionService } from '../../executions/services/companion-executions.companion.service';\nimport {\n CompanionCreateActorTaskRequestSchema,\n CompanionUpdateActorTaskRequestSchema,\n type CompanionCodingAgentStatusResponse,\n} from '../../companion-api/companion-api.schemas';\nimport { GitChangeSetCompanionService, isConcurrentHostLanePath } from './git-change-set.companion.service';\nimport {\n APPLICATION_CODING_AGENT_REF,\n APPLICATION_CODING_TURN_CLASSIFIER_AGENT_REF,\n CodingTurnEndClassificationOutputSchema,\n APPLICATION_CODING_AGENT_REFS,\n isApplicationCodingAgentRef,\n resolveSelectedApplicationCodingAgentBinding,\n} from '../../meta-workflows/models/application-coding-agent.actors-system.definitions';\nimport {\n ChangeSetAttributionClass,\n ApplicationCodingTaskDisposition,\n type ApplicationCodingTaskRunAdmission,\n type ApplicationCodingTaskVerificationPlan,\n DISPATCH_DEFAULT_MAX_CAPTURED_BYTES,\n DISPATCH_DEFAULT_TIMEOUT_MS,\n DISPATCH_HARD_MAX_CAPTURED_BYTES,\n DISPATCH_HARD_MAX_TIMEOUT_MS,\n VerificationKind,\n renderApplicationCodingTaskAgentPrompt,\n resolveApplicationCodingTaskVerificationPlans,\n type GitChangeSetCapture,\n type GitWorktreeSnapshot,\n} from '../models/coding-agent-dispatch.models';\n\n/** Fixed, non-overridable limits for the verification hook subprocess. */\nconst VERIFICATION_TIMEOUT_MS = 10 * 60_000;\nconst VERIFICATION_MAX_CAPTURED_BYTES = 10 * 1024 * 1024;\n\n\n/**\n * The session frames worth retaining on the durable row: what the agent DID and\n * what it changed. Message chunks are already summarised by the output tail, and\n * usage frames are superseded by the recorded totals.\n */\nconst RETAINED_CODING_SESSION_EVENT_KINDS: ReadonlySet<string> = new Set(['tool_call', 'tool_call_update', 'plan']);\n/** Ceiling on retained frames — a bound, not a sample: excess is dropped, never summarised. */\nconst RETAINED_CODING_SESSION_FRAME_LIMIT = 200;\n\n/** Tail size persisted on the task row; full streams go to traceability artifacts. */\nconst OUTPUT_TAIL_CHARS = 16_000;\n\ntype DispatchedTaskRow = Awaited<\n ReturnType<CompanionExecutionsCompanionService['createActorTask']>\n>;\n\ninterface ActiveRunState {\n taskId: string;\n startedAt: string;\n /** Cancels the in-flight coding session. Cooperative first, kill second. */\n abortController: AbortController;\n}\n\n/**\n * A run that PARKED on a genuine question, retained in memory so the operator's\n * answer can resume the SAME agent session with the task's full context.\n *\n * In-process only, by design: the agent persists the session on disk (so\n * `session/load` could resume it after a restart), but the task CONTRACT — the\n * mutation scope the resume must still be held to, the verification plan, the\n * original baseline the final change set is measured against — lives here. A\n * companion restart therefore drops the answerable state, which surfaces as a\n * typed refusal rather than a resume that has forgotten the task's bounds.\n */\nexport interface ParkedCodingSessionState {\n readonly durableTask: DispatchedTaskRow;\n readonly task: ApplicationCodingTaskContract;\n readonly verificationPlans: readonly ApplicationCodingTaskVerificationPlan[];\n readonly baseline: GitWorktreeSnapshot;\n readonly suspension: CodingAgent_SessionSuspension;\n readonly parkedAt: string;\n}\n\n/** Local narrow: is this an indexable object (not null, not an array)? */\nfunction isRecordValue(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/** One live frame relayed to an SSE subscriber: an agent event or a ladder state change. */\nexport interface CodingSessionLiveFrame {\n readonly channel: 'event' | 'state';\n readonly payload: unknown;\n}\n\ninterface VerificationOutcome {\n kind: VerificationKind;\n path: string | null;\n success: boolean;\n message: string;\n stdoutTail: string;\n stderrTail: string;\n}\n\n/** Result of checking every attributed changed-during-run file against the sealed task scope. */\ninterface ApplicationCodingTaskScopeAssessment {\n allowed: boolean;\n violatingPaths: string[];\n /**\n * A commit landed inside the run window, so this window's attribution is\n * INCOMPLETE: a commit empties the dirty set every other class here is\n * computed from, and a parallel session's commit is indistinguishable from\n * the agent's own.\n *\n * RECORDED, NOT REFUSED — decided 2026-08-19, and the reasoning is the same\n * rule the plan applies to every other strictness in this vertical: exactness\n * is retained where a protected, accepted-state or real-effect consumer needs\n * it, and nowhere else. A coding run produces a WORKING result; it mutates no\n * accepted truth. Refusing the whole run here bought no protection of\n * anything accepted, while on a shared tree with parallel sessions ANY commit\n * overlapping ANY run — including one touching nothing the agent touched —\n * failed that run, with no worktree isolation to fall back on (ruled out for\n * this application) and no remedy a single session can enforce.\n *\n * What replaces the refusal is visibility that a consumer cannot miss: the\n * committed paths are recovered into the change set as\n * `COMMITTED_DURING_RUN`, and this flag rides on the recorded result. The\n * OBLIGATION moves with it — whatever later accepts this working result must\n * treat `historyMutated` as attribution it cannot rely on, and must not\n * promote it without review. That is the acceptance tier's job, which is\n * where exactness belongs.\n */\n historyMutated: boolean;\n}\n\n/**\n * Scope checking is deliberately based on the post-run attribution capture,\n * not only clean-baseline files. A baseline-dirty file changed again during a\n * run is not safely attributable to the Agent, but it is still a real effect\n * inside the host window and must not be used to bypass a declared boundary.\n */\nfunction assessApplicationCodingTaskMutationScope(\n changeSet: GitChangeSetCapture,\n allowedPrefixes: readonly string[],\n prohibitedPrefixes: readonly string[],\n): ApplicationCodingTaskScopeAssessment {\n const normalizedAllowed = allowedPrefixes.map(normalizeApplicationRelativePrefix);\n const normalizedProhibited = prohibitedPrefixes.map(normalizeApplicationRelativePrefix);\n /*\n * Committed paths are deliberately EXCLUDED from the scope decision. They are\n * present in `changeSet.files` (as `COMMITTED_DURING_RUN`) so nothing is\n * invisible, but nobody can attribute them: a parallel session's commit and\n * the agent's own look identical from here, so refusing on them would fail\n * runs for other people's work. `historyMutated` carries that fact forward\n * instead, and the acceptance tier decides what an unattributable window is\n * worth.\n */\n /*\n * A disappearance is only a VIOLATION when the run can be held responsible for it, and a commit\n * landing inside the window is precisely when it cannot.\n *\n * `disappearedFromBaseline` is \"dirty at baseline, no longer dirty post-run\", which has two\n * causes that look identical from here: the agent reverted or deleted the file (attributable,\n * and a real boundary breach if the path is out of scope), or a commit emptied the dirty set\n * (not attributable — a parallel session's commit and the agent's own are indistinguishable,\n * which is the exact reasoning the `COMMITTED_DURING_RUN` exclusion above already applies).\n *\n * Including them unconditionally made the two treatments contradict each other: the committed\n * PATHS were excluded as unattributable while the disappearance THAT SAME COMMIT CAUSED was\n * used to fail the run. Measured 2026-08-28 on wonder-crm — a run that stopped cleanly at\n * `end_turn`, honoured every permission decision and wrote NOTHING (`runExclusive: 0`,\n * `appearedDuringRun: 0`) was recorded `mutation_scope_violation` against 13 engine paths it\n * never touched, because a human committed at 17:47:56 and 17 baseline-dirty files left the\n * set. The field's own contract already said they \"are NOT attributed change-set entries\".\n *\n * So the exclusion is conditional, not blanket: with no commit in the window a disappearance\n * IS the run's doing and still fails it. Only the case the run cannot be responsible for is\n * dropped, and it stays visible — the paths remain on `disappearedFromBaseline`, and\n * `historyMutated` tells the acceptance tier the window is unattributable.\n */\n const disappearancesAttributableToTheRun = changeSet.headMovedDuringRun\n ? []\n : changeSet.disappearedFromBaseline;\n\n /*\n * A CONCURRENT_HOST_LANE path is excluded for the same reason a committed one\n * is, and the exclusion is applied in the same place for the same reason: it\n * belongs to a companion lane that runs INSIDE this window and is not this\n * run's to write. The research dispatch takes no workspace-mutation lock by\n * design — it mutates nothing but its own evidence store — and that store is\n * committable and therefore fully visible here, so before this filter one\n * `POST /api/companion/research` overlapping a coding run failed the coding\n * run as `MUTATION_SCOPE_VIOLATION` against files it never touched.\n *\n * Both halves are filtered, and the second is easy to miss: an entry carries\n * an attribution class, while a DISAPPEARANCE is a bare path — so the\n * disappearance of an evidence file a research round rewrote or deleted would\n * still have failed the run. One predicate answers both (its own contract\n * says why it is exported).\n */\n const violatingPaths = [\n ...changeSet.files\n .filter((entry) => entry.attribution !== ChangeSetAttributionClass.COMMITTED_DURING_RUN\n && entry.attribution !== ChangeSetAttributionClass.CONCURRENT_HOST_LANE)\n .map((entry) => entry.path),\n ...disappearancesAttributableToTheRun.filter((path) => !isConcurrentHostLanePath(path)),\n ]\n .filter((path) => {\n const normalizedPath = normalizeApplicationRelativePrefix(path);\n const inAllowedScope = normalizedAllowed.some((prefix) => matchesApplicationRelativePrefix(normalizedPath, prefix));\n const inProhibitedScope = normalizedProhibited.some((prefix) => matchesApplicationRelativePrefix(normalizedPath, prefix));\n return !inAllowedScope || inProhibitedScope;\n });\n return {\n // `historyMutated` does NOT gate admissibility (see the field's contract):\n // it is recorded so the consumer of this working result can see that the\n // window is unattributable, not used to fail a run that protected nothing.\n allowed: violatingPaths.length === 0,\n violatingPaths,\n historyMutated: changeSet.headMovedDuringRun,\n };\n}\n\n/**\n * The LIVE counterpart of {@link assessApplicationCodingTaskMutationScope}:\n * decides, while the agent is still running, whether one absolute path is\n * inside the task's declared mutation scope.\n *\n * Deliberately reuses the SAME normalisation and boundary matching as the\n * post-hoc assessment. Two predicates answering \"is this path in scope?\" with\n * different rules would produce the worst possible outcome — a run permitted\n * live and then judged a scope violation afterwards, or the reverse.\n *\n * It NARROWS and never widens: the permission ceiling still decides the KIND of\n * operation, and this only refuses a path that ceiling would otherwise allow.\n * A path outside the workspace is refused outright rather than reasoned about.\n */\nexport function buildApplicationCodingTaskLocationPredicate(\n workspaceRootPath: string,\n allowedPrefixes: readonly string[],\n prohibitedPrefixes: readonly string[],\n): (absolutePath: string) => boolean {\n const normalizedAllowed = allowedPrefixes.map(normalizeApplicationRelativePrefix);\n const normalizedProhibited = prohibitedPrefixes.map(normalizeApplicationRelativePrefix);\n\n /*\n * Compare against BOTH the configured root and its physical realpath.\n *\n * Agents report CANONICAL absolute paths. Measured live on 2026-08-27: with a\n * workspace under `/var/folders/...` (a macOS symlink to `/private/var/...`),\n * the agent's permission request named the `/private/...` form while the\n * configured root was the `/var/...` form, so an IN-SCOPE edit was refused and\n * the run reported the agent declining to do its job. A scope predicate that\n * silently denies everything is worse than one that denies nothing, because\n * it looks like the agent failing rather than the guard misfiring.\n */\n const candidateRoots = [workspaceRootPath];\n try {\n const physicalRoot = realpathSync.native(workspaceRootPath);\n if (physicalRoot !== workspaceRootPath) {\n candidateRoots.push(physicalRoot);\n }\n } catch {\n // An unresolvable root is left as authored; the relative check below still\n // refuses anything outside it.\n }\n\n return (absolutePath: string): boolean => {\n if (!isAbsolute(absolutePath)) {\n return false;\n }\n const relativePath = candidateRoots\n .map((root) => relative(root, absolutePath))\n .find((candidate) => candidate && !candidate.startsWith('..') && !isAbsolute(candidate));\n if (!relativePath) {\n return false;\n }\n const normalizedPath = normalizeApplicationRelativePrefix(relativePath.split(sep).join('/'));\n const inAllowedScope = normalizedAllowed.some((prefix) => matchesApplicationRelativePrefix(normalizedPath, prefix));\n const inProhibitedScope = normalizedProhibited.some((prefix) => matchesApplicationRelativePrefix(normalizedPath, prefix));\n return inAllowedScope && !inProhibitedScope;\n };\n}\n\nfunction normalizeApplicationRelativePrefix(value: string): string {\n return value.replace(/\\\\/g, '/').replace(/^\\.\\//, '').replace(/\\/+$/, '');\n}\n\n/** Prefix matches require a path boundary: `src/app` does not admit `src/application`. */\nfunction matchesApplicationRelativePrefix(path: string, prefix: string): boolean {\n return path === prefix || path.startsWith(`${prefix}/`);\n}\n\n@injectable()\nexport class CodingAgentDispatchCompanionService {\n private readonly logDebug: (message: string, context?: Record<string, unknown>) => void;\n\n /**\n * In-memory single-flight flag — the FAST 409 in front of the\n * cross-process lockfile, never a replacement for it (P-20).\n */\n private activeRun: ActiveRunState | null = null;\n /**\n * Per-process settlement signal of every application coding task THIS\n * process admitted: resolved when the background run has recorded its\n * terminal durable result (or given up trying). This is the \"owner's\n * completion hook\" the episode driver waits on instead of polling the\n * Actor Task row; a task admitted by a previous process has no entry here,\n * which is correct — restart reconciliation already terminalized it.\n */\n private readonly applicationCodingTaskSettlements = new Map<string, { readonly promise: Promise<void>; resolve(): void }>();\n\n /**\n * Tasks parked on a question, keyed by task id — the answerable set. A task\n * enters here when a run returns a `suspension` and leaves when it is answered\n * (resumed) or explicitly abandoned. See {@link ParkedCodingSessionState}.\n */\n private readonly parkedCodingSessions = new Map<string, ParkedCodingSessionState>();\n\n /**\n * Live-frame subscribers keyed by task id. Fed by the coding session's own\n * event stream and the ladder's state transitions while a run is active;\n * drained by the SSE endpoint. Best-effort throughout — a slow or throwing\n * subscriber never touches the run it observes.\n */\n private readonly codingSessionSubscribers = new Map<string, Set<(frame: CodingSessionLiveFrame) => void>>();\n\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger)\n private readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.ErrorBuilderService)\n private readonly errorBuilder: ErrorBuilderBackendService,\n @inject(COMPANION_SERVICE_TYPES.CompanionContext)\n private readonly companionContext: CompanionContext,\n @inject(SAAS_SERVICE_TYPES.AgentsBackendService)\n private readonly agentsService: AgentsBackendService,\n @inject(COMPANION_SERVICE_TYPES.GitChangeSetService)\n private readonly gitChangeSetService: GitChangeSetCompanionService,\n @inject(COMPANION_SERVICE_TYPES.ExecutionsService)\n private readonly executionsService: CompanionExecutionsCompanionService,\n @inject(COMPANION_SERVICE_TYPES.TraceabilityService)\n private readonly traceabilityService: CompanionTraceabilityService,\n @inject(COMPANION_SERVICE_TYPES.IntrospectionService)\n private readonly introspectionService: CompanionIntrospectionService,\n ) {\n this.logDebug = this.logger.debugByType('CodingAgentDispatchCompanionService');\n this.logger.setDebugTypeLogging('CodingAgentDispatchCompanionService', true);\n }\n\n /**\n * Admit one application-authored coding task onto the normal Flows/Actors\n * Claude Code path — the ONLY coding entry since the raw dispatch endpoint\n * was deleted at the first-activation hard cut. This method accepts only the\n * sealed typed task produced by application composition. The returned\n * acknowledgement is intentionally non-terminal; a completed Actor Task\n * records a working code result and its evidence, never accepted\n * application truth.\n */\n public async runApplicationCodingTask(\n rawTask: ApplicationCodingTaskContract,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<ApplicationCodingTaskRunAdmission> {\n /*\n * Both admission refusals below are TYPED.\n *\n * A malformed contract surfaced as a raw `ZodError` and an unregistered\n * check ref as a plain `Error`, so the two refusals a caller can actually\n * provoke reached the transport as unclassified failures and answered 500\n * INTERNAL — indistinguishable from the host being broken. They are\n * VALIDATION: the request is refused, nothing was locked, created or run.\n */\n const task = this.admitTypedInput(\n () => ApplicationCodingTaskContractSchema.parse(rawTask),\n 'Application coding task contract is not valid.',\n );\n // Resolve before acquiring the lock or creating a task. A semantic check\n // name is not a command and cannot silently fall back to an arbitrary\n // workspace typecheck.\n const verificationPlans = this.admitTypedInput(\n () => resolveApplicationCodingTaskVerificationPlans(task.verificationIntent.requiredChecks),\n 'Application coding task names an unregistered verification check.',\n );\n const traceStep = this.createOperationTraceStep(sessionContext, 'application-coding-task-admission');\n const renderedPrompt = renderApplicationCodingTaskAgentPrompt(task);\n await this.traceOperationStart({\n sessionContext,\n step: traceStep,\n type: 'application-coding-task-admission-start',\n summary: `Admit application coding task ${task.taskRef}`,\n payload: this.buildApplicationCodingTaskTraceSummary(task),\n artifactFileName: 'application-coding-task-input.txt',\n artifactContent: renderedPrompt,\n });\n\n if (this.activeRun) {\n throw this.buildDispatchConflictError(\n `A coding-agent run is already active (task ${this.activeRun.taskId}, started ${this.activeRun.startedAt}). `\n + 'Application coding tasks share the same cross-process mutation lock.',\n );\n }\n\n const admission = createDeferred<{ task: DispatchedTaskRow; baseline: GitWorktreeSnapshot }>();\n const backgroundRun = withDedicatedFileLock(\n this.getWorkspaceMutationLockPath(),\n async () => {\n let admitted: { task: DispatchedTaskRow; baseline: GitWorktreeSnapshot };\n try {\n const baseline = await this.gitChangeSetService.captureWorktreeSnapshot();\n const durableTask = await this.createApplicationCodingTask(task, baseline, sessionContext);\n this.activeRun = {\n taskId: durableTask._id,\n startedAt: new Date().toISOString(),\n abortController: new AbortController(),\n };\n admitted = { task: durableTask, baseline };\n // Registered BEFORE the admission is resolved, so a caller that\n // awaits the settlement right after admission can never miss it.\n const settlement = createDeferred<void>();\n this.applicationCodingTaskSettlements.set(durableTask._id, { promise: settlement.promise, resolve: () => settlement.resolve(undefined) });\n admission.resolve(admitted);\n } catch (error) {\n admission.reject(error);\n return;\n }\n\n try {\n await this.executeApplicationCodingTask(task, renderedPrompt, verificationPlans, admitted.task, admitted.baseline);\n } finally {\n this.activeRun = null;\n this.applicationCodingTaskSettlements.get(admitted.task._id)?.resolve();\n }\n },\n { retries: { retries: 0 } },\n );\n backgroundRun.catch((error: unknown) => {\n admission.reject(this.mapLockError(error));\n this.logDebug('Application coding-task background run chain terminated with error', {\n error: describeCaughtError(error),\n taskRef: task.taskRef,\n });\n });\n\n const admitted = await admission.promise;\n const response: ApplicationCodingTaskRunAdmission = {\n taskId: admitted.task._id,\n status: FlowsActors_Status.PROCESSING,\n taskRef: task.taskRef,\n baselineHeadSha: admitted.baseline.headSha,\n baselineDirtyFileCount: Object.keys(admitted.baseline.files).length,\n };\n await this.traceOperationSuccess({\n sessionContext,\n step: traceStep,\n type: 'application-coding-task-admission-success',\n summary: `Admitted application coding task ${task.taskRef} as Actor Task ${admitted.task._id}`,\n payload: response,\n artifactFileName: 'application-coding-task-admission.json',\n artifactContent: response,\n });\n return response;\n }\n\n /**\n * The settlement of one application coding task admitted by THIS process:\n * resolves once its terminal durable result has been recorded (success or\n * failure) — the only moment a waiting episode can read a non-PROCESSING\n * row. `null` for a task this process did not admit (a previous process's\n * row, already terminalized by restart reconciliation, or an unknown id):\n * there is nothing to wait for, and a caller must not spin on it.\n */\n public awaitApplicationCodingTaskSettlement(taskId: string): Promise<void> | null {\n return this.applicationCodingTaskSettlements.get(taskId)?.promise ?? null;\n }\n\n /**\n * Reconcile only a previous process's unfinished application-coding rows.\n *\n * A companion restart cannot prove the previous Claude Code subprocess is\n * still running. Retrying could duplicate a worktree mutation, while\n * reverting would destroy evidence. The safe v0 result is therefore a\n * terminal physical abort plus an explicit human-review disposition. Root\n * wires this method into ordinary startup in a later, separately reviewed\n * join; this source slice never invokes it automatically.\n */\n public async reconcileInterruptedApplicationCodingTasks(\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<{ reconciledTaskIds: string[] }> {\n const processingTasks = await this.executionsService.listActorTasks({\n status: FlowsActors_Status.PROCESSING,\n limit: 200,\n }, sessionContext);\n const reconciledTaskIds: string[] = [];\n\n for (const task of processingTasks) {\n // MEMBERSHIP, not equality with one constant: with a second declared coding\n // agent, equality silently skips every task addressed to it — a task never\n // claimed and never reported, which is worse than one that fails loudly.\n if (!isApplicationCodingAgentRef(task.actors?.actorRef)) continue;\n /*\n * A PARKED task is deliberately PROCESSING with no live child — its agent process is already\n * closed and the answer resumes the persisted session via `session/load`. That is the ONE\n * PROCESSING shape a restart must NOT terminalize: surviving the restart is the suspension's\n * whole design (`reconstructParkedCodingTaskForResume` re-selects it from the build plan).\n * Measured 2026-09-04, first live park on a restart: this sweep terminalized the parked row\n * and nulled its suspension three seconds before the operator's answer arrived, so the\n * restart-durability door refused with \"no coding task is awaiting an answer\". Only a FRESH,\n * RESUMABLE suspension is exempt — an expired `parkedUntil`, or an agent that cannot\n * `session/load`, leaves a question nobody can answer on the same session, and terminalizing\n * it for review is then the honest outcome.\n */\n const parkedOutput = (task as { output?: { disposition?: unknown; suspension?: unknown } }).output;\n if (parkedOutput?.disposition === ApplicationCodingTaskDisposition.AWAITING_OPERATOR_INPUT) {\n const parsedSuspension = CodingAgent_SessionSuspensionSchema.safeParse(parkedOutput.suspension);\n const stillAnswerable = parsedSuspension.success\n && parsedSuspension.data.resumable\n && Date.parse(parsedSuspension.data.parkedUntil) > Date.now();\n if (stillAnswerable) continue;\n }\n let currentSnapshot: GitWorktreeSnapshot | null = null;\n let captureError: unknown = null;\n try {\n currentSnapshot = await this.gitChangeSetService.captureWorktreeSnapshot();\n } catch (error) {\n captureError = error;\n }\n\n const updatePayload = CompanionUpdateActorTaskRequestSchema.parse({\n status: FlowsActors_Status.ABORTED,\n output: {\n succeeded: false,\n disposition: ApplicationCodingTaskDisposition.INTERRUPTED_REQUIRES_REVIEW,\n recoveryEvidence: currentSnapshot\n ? {\n headSha: currentSnapshot.headSha,\n dirtyFileCount: Object.keys(currentSnapshot.files).length,\n capturedAt: currentSnapshot.capturedAt,\n }\n : null,\n ...(captureError ? { recoveryCaptureError: buildOutputErrorPayload(captureError) } : {}),\n },\n });\n await this.executionsService.updateActorTask(task._id, updatePayload, sessionContext);\n reconciledTaskIds.push(task._id);\n }\n\n return { reconciledTaskIds };\n }\n\n /**\n * Readiness snapshot for the status route. HONESTY CONTRACT: the\n * underlying `isAvailable()` checks ONLY that the provider registry\n * exposes an AGENT_CLIENT_PROTOCOL contract for anthropic — it does NOT\n * guarantee the ACP adapter is installed, spawnable, or authenticated. A\n * `true` here can still be followed by a spawn/auth failure at run time.\n */\n /**\n * The cross-process workspace-mutation lock path (P-19b) — one lock for\n * every mutating coding run against this application worktree.\n */\n public getWorkspaceMutationLockPath(): string {\n return resolveWorkspaceMutationLockPath(this.companionContext.saasRoot);\n }\n\n /**\n * Cancel the in-flight coding run, if there is one.\n *\n * Cooperative by construction: this signals the session, and the runner sends\n * `session/cancel` and waits before killing anything. The run therefore\n * TERMINALISES NORMALLY — with stop reason `cancelled` and a captured change\n * set — rather than vanishing. That distinction is the whole point: an\n * operator who stops a run still needs to know what it had already written.\n *\n * Returns the task that was asked to stop, or `null` when nothing is running.\n * Idempotent: cancelling an already-cancelled run signals an aborted\n * controller again, which is a no-op.\n */\n public cancelActiveApplicationCodingTask(): { taskId: string; startedAt: string } | null {\n const active = this.activeRun;\n if (!active) {\n return null;\n }\n this.logDebug('Cancelling active application coding task', { taskId: active.taskId });\n active.abortController.abort();\n return { taskId: active.taskId, startedAt: active.startedAt };\n }\n\n public getStatus(): CompanionCodingAgentStatusResponse {\n return {\n // Reports a fact this service can actually establish: whether the coding\n // agent is registered. It deliberately does NOT claim the transport is\n // usable — that depends on the provider configuration and on an agent\n // process this service has not started, and a status field that overstates\n // its knowledge is worse than one that is narrow about it.\n // Every declared agent must resolve, not merely the default: a registry\n // missing the SELECTED agent reports healthy while dispatch refuses.\n codingAgentRegistered: APPLICATION_CODING_AGENT_REFS.every(\n (ref) => this.agentsService.getAgent(ref) !== undefined,\n ),\n activeRun: this.activeRun ? { taskId: this.activeRun.taskId, startedAt: this.activeRun.startedAt } : null,\n // The answerable set: what is parked waiting for an operator response.\n pendingQuestions: this.listPendingCodingQuestions(),\n limits: {\n defaultTimeoutMs: DISPATCH_DEFAULT_TIMEOUT_MS,\n hardMaxTimeoutMs: DISPATCH_HARD_MAX_TIMEOUT_MS,\n defaultMaxCapturedBytes: DISPATCH_DEFAULT_MAX_CAPTURED_BYTES,\n hardMaxCapturedBytes: DISPATCH_HARD_MAX_CAPTURED_BYTES,\n },\n lockFilePath: this.getWorkspaceMutationLockPath(),\n };\n }\n\n /**\n * Persist only replayable task identity and guard evidence, never\n * prompt/context bytes.\n *\n * CORRELATION BACK TO THE EPISODE runs through `input.candidateRef`, which is\n * the assessment episode's working-subject identity for the iteration that\n * composed this task — the same value the private checkpoint carries as\n * `basis.episode.candidateRef`. It is recorded here deliberately so the join\n * exists in BOTH directions: the checkpoint names the taskId once the task is\n * admitted, and this row names the candidate that caused it, so an auditor\n * starting from a workspace mutation can reach the episode without scanning\n * every checkpoint.\n *\n * A dedicated `episodeRef` column is NOT added: no caller supplies one yet\n * (the coding revision owner lands later), and a field with no producer is a\n * dormant surface that later readers mistake for a guarantee. The candidate\n * ref is exact per ITERATION, which is the granularity an auditor wants.\n */\n private async createApplicationCodingTask(\n task: ApplicationCodingTaskContract,\n baseline: GitWorktreeSnapshot,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<DispatchedTaskRow> {\n const payload = CompanionCreateActorTaskRequestSchema.parse({\n title: `Application coding task ${task.taskRef}`,\n /* The cross-plane join key — the board's build-plan row this task executes (Phase 4, R5). */\n workbenchBuildPlanTaskId: sanitizeWorkbenchCreationPlaneIdentity(task.taskRef),\n description: `Typed application coding task for ${task.objectiveRef}; acceptance remains outside the coding host.`,\n topic: Actor_Task_Topics.IMPLEMENTATION,\n status: FlowsActors_Status.PROCESSING,\n // The SELECTED agent, resolved once at creation and carried on the row —\n // so a task records which agent it was addressed to, and a selection\n // changed between creation and claim cannot silently redirect it.\n actors: { actorRef: resolveSelectedApplicationCodingAgentBinding().ref },\n input: {\n taskRef: task.taskRef,\n objectiveRef: task.objectiveRef,\n candidateRef: task.candidateRef,\n mutationScope: task.mutationScope,\n contextPlan: {\n planRef: task.contextPlan.planRef,\n objectiveRef: task.contextPlan.objectiveRef,\n },\n contextSelection: {\n planRef: task.contextSelection.planRef,\n selectedSourceRefs: task.contextSelection.selectedSources.map((source) => source.sourceRef),\n selectedSourceCount: task.contextSelection.selectedSources.length,\n },\n verificationIntent: task.verificationIntent,\n installedSkillRefs: task.installedSkillRefs,\n baseline: {\n headSha: baseline.headSha,\n dirtyFileCount: Object.keys(baseline.files).length,\n capturedAt: baseline.capturedAt,\n },\n },\n context: {},\n startedAt: new Date().toISOString(),\n });\n return this.executionsService.createActorTask(payload, sessionContext);\n }\n\n /**\n * Executes the normal Agent invocation and lands the full working-result\n * evidence. This method runs inside the worktree lock and therefore is the\n * sole typed path allowed to observe its own before/after Git boundary.\n */\n private async executeApplicationCodingTask(\n task: ApplicationCodingTaskContract,\n renderedPrompt: string,\n verificationPlans: readonly ApplicationCodingTaskVerificationPlan[],\n durableTask: DispatchedTaskRow,\n baseline: GitWorktreeSnapshot,\n /**\n * Present when this run ANSWERS a parked question rather than starting the\n * task: the agent session is resumed by id via `session/load` and the answer\n * is delivered as the next turn. The task's mutation scope, verification plan\n * and original baseline are unchanged — the resume is held to exactly the\n * bounds the first run was.\n */\n resume?: { readonly continuationOfSessionId: string; readonly answerPrompt: string },\n ): Promise<void> {\n let runSession: CompanionExecutionSessionContext | undefined;\n let runStep: ReturnType<CompanionTraceabilityService['createStep']> | undefined;\n const traceabilityErrors: unknown[] = [];\n const traceBestEffort = async (operation: string, write: () => Promise<void>): Promise<void> => {\n try {\n await write();\n } catch (error) {\n // Traceability is required evidence, but it must not become a control\n // flow escape that leaves the durable task PROCESSING after possible\n // source changes. The final task row records this failure and remains\n // visibly non-accepted for explicit follow-up.\n traceabilityErrors.push(error);\n this.logger.error('Application coding-task trace operation failed', {\n taskId: durableTask._id,\n taskRef: task.taskRef,\n operation,\n error: describeCaughtError(error),\n });\n }\n };\n await traceBestEffort('initialize-session', async () => {\n runSession = this.traceabilityService.createInternalSession({\n label: 'application-coding-task-run',\n metadata: { taskId: durableTask._id, taskRef: task.taskRef },\n });\n if (!runSession) return;\n await this.traceabilityService.registerAlias(runSession, CompanionTraceAliasKind.ACTOR_TASK, durableTask._id);\n runStep = this.createOperationTraceStep(runSession, 'application-coding-task-run');\n });\n const traceContext: AgentTraceContext = {\n label: `application-coding-task:${task.taskRef}`,\n attributes: {\n taskId: durableTask._id,\n taskRef: task.taskRef,\n objectiveRef: task.objectiveRef,\n candidateRef: task.candidateRef,\n },\n };\n const invocation: FlowsActors_Agent_Invocation<\n typeof CodingAgent_RunTaskInputSchema,\n typeof CodingAgent_RunTaskOutputSchema,\n typeof CodingAgent_OperationContext_BaseSchema\n > = {\n agentRef: APPLICATION_CODING_AGENT_REF,\n initiator: {},\n invocationContext: [],\n // A resume delivers the operator's ANSWER as the turn and re-enters the\n // parked session; a first run delivers the rendered task.\n input: resume\n ? { prompt: resume.answerPrompt, continuationOfSessionId: resume.continuationOfSessionId }\n : { prompt: renderedPrompt },\n output: { finalMessage: '', stopReason: CodingAgent_StopReason.END_TURN },\n executionContext: { callTimestamp: new Date().toISOString() },\n artifactBindings: [],\n };\n\n const startedAtMs = Date.now();\n let runError: unknown = null;\n let agentOutput = '';\n let codingUsage: CodingAgent_Usage | undefined;\n let codingDeniedPermissionCount: number | undefined;\n let codingPermissionDecisions: CodingAgent_RunTaskOutput['permissionDecisions'];\n let agentStopReason: CodingAgent_StopReason | undefined;\n /*\n * Counted in full, RETAINED in part.\n *\n * The previous shape pushed every notification into an unbounded array and\n * then persisted only its length — so a 30-minute run grew memory the\n * process never read, and the tool-call and diff frames (the reason to\n * observe a session at all) were collected and discarded. Now the count is a\n * counter, and only the frames a reader would actually open are retained, up\n * to a fixed ceiling.\n */\n let codingSessionEventCount = 0;\n const retainedCodingSessionFrames: Array<{ readonly kind: string; readonly payload: unknown }> = [];\n await traceBestEffort('record-start', () => this.traceOperationStart({\n sessionContext: runSession,\n step: runStep,\n type: 'application-coding-task-run-start',\n summary: `Run application coding task ${task.taskRef}`,\n payload: this.buildApplicationCodingTaskTraceSummary(task),\n artifactFileName: 'application-coding-task-input.txt',\n artifactContent: renderedPrompt,\n }));\n try {\n const response = await this.agentsService.invokeAgent(\n invocation,\n traceContext,\n {\n workspaceRootPath: this.companionContext.saasRoot,\n // Hold the agent to the task's declared scope WHILE it runs, not only\n // in the change set afterwards. The post-hoc assessment stays — it is\n // the authoritative record, because an agent can write a file it never\n // asked permission for — but a refusal in the moment is the only one\n // that prevents the write rather than reporting it.\n isPermittedCodingLocation: buildApplicationCodingTaskLocationPredicate(\n this.companionContext.saasRoot,\n task.mutationScope.allowedPathPrefixes,\n task.mutationScope.prohibitedPathPrefixes,\n ),\n onCodingSessionEvent: (event) => {\n codingSessionEventCount += 1;\n if (\n retainedCodingSessionFrames.length < RETAINED_CODING_SESSION_FRAME_LIMIT\n && RETAINED_CODING_SESSION_EVENT_KINDS.has(event.kind)\n ) {\n retainedCodingSessionFrames.push(event);\n }\n this.publishCodingSessionFrame(durableTask._id, { channel: 'event', payload: event });\n },\n // The JUDGMENT half of the interactive lane: classify each end-of-turn\n // message so the engine ladder can auto-continue a self-pause and park\n // a genuine question. The engine fails OPEN if this throws, so a\n // classifier fault degrades to \"the turn is complete\" rather than\n // hanging the run — this method may therefore throw freely.\n classifyCodingTurnEnd: (input) => this.classifyCodingTurnEnd(input),\n onCodingSessionStateChange: (state) => {\n this.publishCodingSessionFrame(durableTask._id, { channel: 'state', payload: state });\n },\n ...(this.activeRun ? { codingSessionAbortSignal: this.activeRun.abortController.signal } : {}),\n },\n );\n const codingOutput = response.output as Partial<CodingAgent_RunTaskOutput> | undefined;\n // The agent runtime publishes provider-learned facts on `executionContext`.\n codingUsage = (response.executionContext as { usage?: CodingAgent_Usage } | undefined)?.usage;\n codingDeniedPermissionCount = codingOutput?.deniedPermissionCount;\n codingPermissionDecisions = codingOutput?.permissionDecisions;\n const text = codingOutput?.finalMessage;\n agentStopReason = codingOutput?.stopReason;\n // A PARKED run stopped WITHOUT finishing to ask the operator a question.\n // Its `finalMessage` is the question and its partial edits are NOT a final\n // change set — so it must skip assessment, verification and the\n // terminal disposition entirely, and instead record an answerable,\n // non-terminal state. Handled here, before the CANCELLED/empty checks,\n // because a question is a non-empty END_TURN message that would otherwise\n // read as a completed working result.\n if (codingOutput?.suspension) {\n await this.recordParkedApplicationCodingTask({\n task,\n verificationPlans,\n durableTask,\n baseline,\n suspension: codingOutput.suspension,\n output: codingOutput,\n usage: codingUsage,\n codingSessionEventCount,\n retainedCodingSessionFrames,\n startedAtMs,\n runSession,\n runStep,\n traceBestEffort,\n });\n return;\n }\n // A CANCELLED turn is not a completed one, and its partial change set must\n // not be read as a working result. Refused here rather than downstream so\n // the disposition names the actual reason.\n if (agentStopReason === CodingAgent_StopReason.CANCELLED) {\n throw new Error('Application coding Agent turn was cancelled before it completed.');\n }\n if (typeof text !== 'string' || text.trim().length === 0) {\n throw new Error('Application coding Agent returned no final message.');\n }\n agentOutput = text;\n } catch (error) {\n runError = error;\n }\n\n let changeSet: GitChangeSetCapture | null = null;\n let captureError: unknown = null;\n try {\n changeSet = await this.gitChangeSetService.captureChangeSet(baseline);\n } catch (error) {\n captureError = error;\n }\n\n const scopeAssessment = changeSet\n ? assessApplicationCodingTaskMutationScope(changeSet, task.mutationScope.allowedPathPrefixes, task.mutationScope.prohibitedPathPrefixes)\n : null;\n /*\n * Did Wildo's IN-FLIGHT guards actually run for this agent?\n *\n * The permission ceiling and the task mutation scope are both enforced in\n * the client's answer to `session/request_permission`, and the scope half is\n * enforced against the `locations` that request DECLARES. So there are TWO\n * ways a run reaches the end with the mutation scope never consulted, and\n * until 2026-09-09 only the first was reported:\n *\n * 1. NO REQUEST AT ALL — the agent writes without asking. Codex's design\n * (its safety model is a sandbox) and OpenCode's default. Nothing is\n * answered, so nothing is checked.\n *\n * 2. REQUESTS RAISED, NONE CARRYING A LOCATION — the agent asks, the\n * client answers, and the scope predicate has nothing to check the\n * answer against, because `locations.some(...)` over an empty array is\n * vacuously satisfied. Under an UNRESTRICTED ceiling this is EVERY\n * shell command: `execute` is admitted by the ceiling, and a shell\n * command declares no locations because its effect is not derivable\n * from the command string. A run can therefore write outside its\n * declared scope through a shell command with a full, well-formed\n * permission-decision record showing it was allowed.\n *\n * Shape 2 is not a hole to be closed by deriving locations from a command —\n * a shell command is UNSCOPED BY NATURE, and parsing one to guess its writes\n * would be an invented, defeatable answer (`sh -c \"$CMD\"`, a redirect\n * through a substituted path). The honest treatment is to say so.\n *\n * Both shapes are ADMISSIBLE by decision (2026-09-06/09): a different agent\n * architecture is not a reason to refuse a tool, the dogfood lane authors\n * UNRESTRICTED deliberately, and the framework's directive is that\n * restrictions arrive as judge-style guards rather than refusals wired into\n * the mechanism. What is NOT acceptable is the consequence going unrecorded\n * while the configuration reads as though a gate were in place.\n *\n * Keyed on the run's OWN evidence rather than on a provider declaration: an\n * agent that changes behaviour between versions cannot silently keep an\n * old, reassuring claim. (The provider's declaration is used too, at\n * DISPATCH, where it refuses a ceiling narrower than UNRESTRICTED against an\n * agent that cannot honour one — a claim before the run and evidence after\n * it, which are different jobs.)\n */\n const raisedNoPermissionRequest = (codingPermissionDecisions?.length ?? 0) === 0;\n // An ALLOWED decision that declared no path: the ceiling admitted the act and\n // the scope predicate was handed nothing to judge it by.\n const allowedActsWithNoDeclaredLocation = (codingPermissionDecisions ?? []).filter(\n (decision) => decision.allowed && decision.locations.length === 0,\n ).length;\n const mutationScopeWentUnconsulted = raisedNoPermissionRequest || allowedActsWithNoDeclaredLocation > 0;\n const mutatedFileCount = changeSet?.files.length ?? 0;\n if (!runError && mutationScopeWentUnconsulted && mutatedFileCount > 0) {\n // Best-effort and FEATURE-DETECTED, the same posture the audit emits take:\n // this observes a run, and an observation that can fail the run it\n // observes is worse than no observation. A partially-bound logger must not\n // turn a completed coding task into an error — measured the hard way, when\n // a `warn` the test double did not implement hung fifteen runs.\n this.logger.warn?.(\n (raisedNoPermissionRequest\n ? 'Coding run mutated the workspace without raising a single permission request — '\n + \"Wildo's permission ceiling and task mutation scope were NOT enforced in flight for this agent. \"\n : `Coding run mutated the workspace after ${allowedActsWithNoDeclaredLocation} permitted act(s) that `\n + 'declared no file location — typically shell commands, which are unscoped by nature — so the task '\n + 'mutation scope had nothing to check those acts against and was NOT enforced in flight for them. ')\n + 'The change set taken after the run is the only record of what it touched'\n + (scopeAssessment && !scopeAssessment.allowed\n ? ', and it detected a write outside the task\\'s declared scope AFTER the fact.'\n : '.'),\n {\n taskRef: task.taskRef,\n objectiveRef: task.objectiveRef,\n mutationScopeRef: task.mutationScope.scopeRef,\n mutatedFileCount,\n scopeAssessmentAllowed: scopeAssessment?.allowed ?? null,\n raisedNoPermissionRequest,\n allowedActsWithNoDeclaredLocation,\n inFlightMutationScopeConsulted: false,\n },\n );\n }\n\n // Verification is deliberately sequential. Each check has a fixed\n // semantic meaning, but several checks can still contend for the same\n // application package/cache if started together. The ordered outcomes are\n // easier to inspect and avoid turning a bounded coding task into an\n // accidental local-build fan-out.\n const shouldVerify = !runError && !captureError && scopeAssessment?.allowed === true;\n const { verification, infrastructureError: verificationInfrastructureError } = shouldVerify\n ? await this.executeVerificationPlans(verificationPlans)\n : { verification: [] as Array<{ checkRef: string; outcome: VerificationOutcome }>, infrastructureError: null as unknown };\n const failedVerification = verification.find(({ outcome }) => !outcome.success) ?? null;\n\n if (agentOutput) {\n await traceBestEffort('write-agent-output', () =>\n this.traceOperationArtifact(runSession, runStep, 'application-coding-task-agent-output.txt', agentOutput));\n }\n if (changeSet?.fullDiffText) {\n await traceBestEffort('write-change-set', () =>\n this.traceOperationArtifact(runSession, runStep, 'application-coding-task-change-set.diff', changeSet.fullDiffText));\n }\n\n const disposition = runError\n ? ApplicationCodingTaskDisposition.AGENT_EXECUTION_FAILED\n : captureError\n ? ApplicationCodingTaskDisposition.CHANGE_SET_CAPTURE_FAILED\n : !scopeAssessment?.allowed\n ? ApplicationCodingTaskDisposition.MUTATION_SCOPE_VIOLATION\n : failedVerification\n ? ApplicationCodingTaskDisposition.VERIFICATION_FAILED\n : traceabilityErrors.length > 0\n ? ApplicationCodingTaskDisposition.TRACEABILITY_FAILED\n : ApplicationCodingTaskDisposition.WORKING_RESULT_RECORDED;\n const succeeded = disposition === ApplicationCodingTaskDisposition.WORKING_RESULT_RECORDED;\n const output = {\n succeeded,\n disposition,\n durationMs: Date.now() - startedAtMs,\n agentOutputTail: agentOutput.slice(-OUTPUT_TAIL_CHARS),\n // Recorded on the durable row because it is the difference between \"the\n // agent finished\" and \"the agent stopped\": a turn that ended on\n // `max_tokens` or `refusal` leaves a partial change set that looks exactly\n // like a complete one from the diff alone.\n ...(agentStopReason ? { agentStopReason } : {}),\n ...(codingSessionEventCount > 0 ? { codingSessionEventCount } : {}),\n ...(retainedCodingSessionFrames.length > 0 ? { codingSessionFrames: retainedCodingSessionFrames } : {}),\n // #2: the run's real cost, recorded on the durable row.\n //\n // This is what the previous transport structurally could not report, and\n // it was captured by the runner and dropped here — so the budget still saw\n // nothing. `usage` is optional in every field by contract, so absence is\n // preserved as absence rather than written as zero.\n ...(codingUsage ? { usage: codingUsage } : {}),\n ...(codingDeniedPermissionCount !== undefined\n ? { deniedPermissionCount: codingDeniedPermissionCount }\n : {}),\n // WHY each permission was decided, beside how many were refused. A refusal an operator\n // cannot explain is a refusal they cannot act on — see the field's contract.\n ...(codingPermissionDecisions && codingPermissionDecisions.length > 0\n ? { permissionDecisions: codingPermissionDecisions }\n : {}),\n ...(runError ? { error: buildOutputErrorPayload(runError) } : {}),\n ...(captureError ? { changeSetCaptureError: buildOutputErrorPayload(captureError) } : {}),\n ...(verificationInfrastructureError ? { verificationInfrastructureError: buildOutputErrorPayload(verificationInfrastructureError) } : {}),\n ...(traceabilityErrors.length > 0 ? { traceabilityErrors: traceabilityErrors.map(buildOutputErrorPayload) } : {}),\n ...(scopeAssessment ? { scopeAssessment } : {}),\n verification,\n ...(changeSet ? {\n changeSetSummary: {\n baselineHeadSha: changeSet.baselineHeadSha,\n postRunHeadSha: changeSet.postRunHeadSha,\n headMovedDuringRun: changeSet.headMovedDuringRun,\n stats: changeSet.stats,\n },\n } : { changeSetSummary: null }),\n };\n\n try {\n const updatePayload = CompanionUpdateActorTaskRequestSchema.parse({\n status: succeeded ? FlowsActors_Status.COMPLETED : FlowsActors_Status.FAILED,\n output,\n ...(changeSet ? { artifacts: [buildChangeSetArtifact(durableTask._id, changeSet)] } : {}),\n });\n await this.executionsService.updateActorTask(durableTask._id, updatePayload, runSession);\n } catch (error) {\n // Do not turn a failed durable PATCH into a retry: the agent may already\n // have changed files and re-execution would duplicate an unclassified\n // effect. The PROCESSING row is deliberately visible for the explicit\n // restart-review hook, while the trace records why it was not terminal.\n this.logger.error('Failed to persist terminal application coding-task result', {\n taskId: durableTask._id,\n taskRef: task.taskRef,\n error: describeCaughtError(error),\n });\n await traceBestEffort('record-terminal-patch-failure', () => this.traceOperationFailure({\n sessionContext: runSession,\n step: runStep,\n type: 'application-coding-task-terminal-patch-failure',\n summary: `Failed to persist terminal result for application coding task ${task.taskRef}`,\n error,\n payload: output,\n }));\n return;\n }\n\n if (succeeded) {\n await traceBestEffort('record-success', () => this.traceOperationSuccess({\n sessionContext: runSession,\n step: runStep,\n type: 'application-coding-task-run-success',\n summary: `Recorded working result for application coding task ${task.taskRef}`,\n payload: output,\n }));\n return;\n }\n await traceBestEffort('record-failure', () => this.traceOperationFailure({\n sessionContext: runSession,\n step: runStep,\n type: 'application-coding-task-run-failure',\n summary: `Application coding task ${task.taskRef} requires follow-up`,\n error: runError ?? captureError ?? verificationInfrastructureError ?? traceabilityErrors[0] ?? new Error(`Application coding task disposition: ${disposition}`),\n payload: output,\n }));\n }\n\n // ================================================================\n // Interactive lane — classifier, live relay, park & resume\n // ================================================================\n\n /**\n * Classify a coding agent's end-of-turn message through the dedicated\n * structured classifier agent. Throws on any fault; the ENGINE ladder wraps\n * that into `CLASSIFIER_UNAVAILABLE` and settles, so this never has to invent\n * a safe default of its own.\n */\n private async classifyCodingTurnEnd(input: {\n readonly finalMessage: string;\n readonly turnIndex: number;\n }): Promise<CodingAgent_EndOfTurnClassification> {\n const prompt = [\n 'A coding agent ended its turn with the message below. Classify what the message means so an '\n + 'autonomous runner can decide whether to continue automatically, or to surface a question to '\n + 'the operator.',\n '',\n '# Agent end-of-turn message',\n input.finalMessage,\n ].join('\\n');\n const invocation: FlowsActors_Agent_Invocation<any, any> = {\n agentRef: APPLICATION_CODING_TURN_CLASSIFIER_AGENT_REF,\n initiator: {},\n invocationContext: [],\n input: { prompt, schema: CodingTurnEndClassificationOutputSchema },\n output: { object: {} },\n executionContext: {},\n artifactBindings: [],\n };\n const response = await this.agentsService.invokeAgent(invocation);\n const raw = (response.output as { object?: unknown } | undefined)?.object;\n const parsed = CodingTurnEndClassificationOutputSchema.safeParse(raw);\n if (!parsed.success) {\n // A malformed classifier answer is a classifier fault: let the ladder fail\n // open rather than guess which situation the model meant.\n throw new Error('Coding turn-end classifier returned an unparseable result.');\n }\n return parsed.data.classification;\n }\n\n /** Fan one live frame out to a task's SSE subscribers. Best-effort, never throws into the run. */\n private publishCodingSessionFrame(taskId: string, frame: CodingSessionLiveFrame): void {\n const listeners = this.codingSessionSubscribers.get(taskId);\n if (!listeners) return;\n for (const listener of listeners) {\n try {\n listener(frame);\n } catch {\n // A subscriber must never be able to fail the run it observes.\n }\n }\n }\n\n /**\n * Subscribe to a task's live coding frames. Returns an unsubscribe function.\n *\n * Frames flow only while a run is ACTIVE for that task; a subscriber that\n * attaches after the run parked or finished simply receives nothing further,\n * which is why the SSE endpoint sends the current pending question up front.\n */\n public subscribeToCodingSession(taskId: string, listener: (frame: CodingSessionLiveFrame) => void): () => void {\n let listeners = this.codingSessionSubscribers.get(taskId);\n if (!listeners) {\n listeners = new Set();\n this.codingSessionSubscribers.set(taskId, listeners);\n }\n listeners.add(listener);\n return () => {\n const set = this.codingSessionSubscribers.get(taskId);\n if (!set) return;\n set.delete(listener);\n if (set.size === 0) this.codingSessionSubscribers.delete(taskId);\n };\n }\n\n /** The questions currently awaiting an operator answer, for status/UX. */\n public listPendingCodingQuestions(): Array<{ taskId: string; taskRef: string; question: string; parkedAt: string; resumable: boolean }> {\n return [...this.parkedCodingSessions.values()].map((parked) => ({\n taskId: parked.durableTask._id,\n taskRef: parked.task.taskRef,\n question: parked.suspension.question,\n parkedAt: parked.parkedAt,\n resumable: parked.suspension.resumable,\n }));\n }\n\n /**\n * Record a run that parked on a question: persist the non-terminal durable row\n * (status PROCESSING, disposition AWAITING_OPERATOR_INPUT, question on the\n * output) and retain the answerable state in memory for the resume door.\n *\n * Deliberately skips change-set assessment and verification: a parked run's\n * edits are partial by definition, and assessing them as a final change set is\n * exactly the \"read a suspended turn as complete\" mistake the suspension field\n * exists to prevent.\n */\n private async recordParkedApplicationCodingTask(params: {\n task: ApplicationCodingTaskContract;\n verificationPlans: readonly ApplicationCodingTaskVerificationPlan[];\n durableTask: DispatchedTaskRow;\n baseline: GitWorktreeSnapshot;\n suspension: CodingAgent_SessionSuspension;\n output: Partial<CodingAgent_RunTaskOutput>;\n usage: CodingAgent_Usage | undefined;\n codingSessionEventCount: number;\n retainedCodingSessionFrames: Array<{ readonly kind: string; readonly payload: unknown }>;\n startedAtMs: number;\n runSession: CompanionExecutionSessionContext | undefined;\n runStep: ReturnType<CompanionTraceabilityService['createStep']> | undefined;\n traceBestEffort: (operation: string, write: () => Promise<void>) => Promise<void>;\n }): Promise<void> {\n const { task, durableTask, baseline, suspension, output, verificationPlans } = params;\n\n this.parkedCodingSessions.set(durableTask._id, {\n durableTask,\n task,\n verificationPlans,\n baseline,\n suspension,\n parkedAt: new Date().toISOString(),\n });\n\n const durableOutput = {\n succeeded: false,\n disposition: ApplicationCodingTaskDisposition.AWAITING_OPERATOR_INPUT,\n durationMs: Date.now() - params.startedAtMs,\n // The question the operator must answer, front and centre.\n pendingQuestion: suspension.question,\n suspension,\n agentOutputTail: (output.finalMessage ?? '').slice(-OUTPUT_TAIL_CHARS),\n ...(output.stopReason ? { agentStopReason: output.stopReason } : {}),\n ...(output.turnCount ? { turnCount: output.turnCount } : {}),\n ...(output.continuations && output.continuations.length > 0 ? { continuations: output.continuations } : {}),\n ...(params.codingSessionEventCount > 0 ? { codingSessionEventCount: params.codingSessionEventCount } : {}),\n ...(params.retainedCodingSessionFrames.length > 0 ? { codingSessionFrames: params.retainedCodingSessionFrames } : {}),\n ...(params.usage ? { usage: params.usage } : {}),\n ...(output.deniedPermissionCount !== undefined ? { deniedPermissionCount: output.deniedPermissionCount } : {}),\n ...(output.permissionDecisions && output.permissionDecisions.length > 0 ? { permissionDecisions: output.permissionDecisions } : {}),\n };\n\n // Status stays PROCESSING: the task is genuinely still in flight, waiting on\n // the operator. It is not COMPLETED (nothing was accepted) and not FAILED\n // (nothing went wrong) — the disposition carries the real state.\n const updatePayload = CompanionUpdateActorTaskRequestSchema.parse({\n status: FlowsActors_Status.PROCESSING,\n output: durableOutput,\n });\n await this.executionsService.updateActorTask(durableTask._id, updatePayload, params.runSession);\n\n await params.traceBestEffort('record-awaiting-input', () => this.traceOperationStart({\n sessionContext: params.runSession,\n step: params.runStep,\n type: 'application-coding-task-awaiting-input',\n summary: `Application coding task ${task.taskRef} is awaiting an operator answer`,\n payload: { taskId: durableTask._id, question: suspension.question, resumable: suspension.resumable },\n }));\n }\n\n /** The in-process answerable state for a parked task, if this process is the one that parked it. */\n public getParkedCodingSessionState(taskId: string): ParkedCodingSessionState | null {\n return this.parkedCodingSessions.get(taskId) ?? null;\n }\n\n /**\n * Load the DURABLE facts needed to RECONSTRUCT a parked task's answerable state\n * after the in-process map has lost it (a companion restart).\n *\n * Returns the build-plan `taskRef` and the persisted `suspension` — enough for\n * the build-dispatch layer to re-compose the task contract and rebuild a\n * {@link ParkedCodingSessionState}. `null` when the row is not a parked coding\n * task (wrong actor, no suspension, or not found).\n */\n public async loadPersistedParkedCodingTask(\n taskId: string,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<{ taskRef: string; suspension: CodingAgent_SessionSuspension; durableTask: DispatchedTaskRow } | null> {\n let durableTask: DispatchedTaskRow;\n try {\n durableTask = await this.executionsService.getActorTask(taskId, sessionContext) as DispatchedTaskRow;\n } catch {\n return null;\n }\n const row = durableTask as { actors?: { actorRef?: string }; input?: unknown; output?: unknown };\n if (row.actors?.actorRef !== APPLICATION_CODING_AGENT_REF) return null;\n const taskRef = isRecordValue(row.input) && typeof row.input.taskRef === 'string' ? row.input.taskRef : null;\n const suspensionRaw = isRecordValue(row.output) ? row.output.suspension : undefined;\n const parsedSuspension = CodingAgent_SessionSuspensionSchema.safeParse(suspensionRaw);\n if (!taskRef || !parsedSuspension.success) return null;\n return { taskRef, suspension: parsedSuspension.data, durableTask };\n }\n\n /**\n * Answer a parked coding task's question and resume the SAME agent session.\n *\n * The IN-PROCESS door: it answers a task THIS process parked. For a task whose\n * in-process state was lost to a restart, the caller reconstructs a\n * {@link ParkedCodingSessionState} (from the build plan) and uses\n * {@link resumeParkedCodingTask} directly.\n */\n public async respondToApplicationCodingTaskQuestion(\n taskId: string,\n answer: string,\n ): Promise<ApplicationCodingTaskRunAdmission> {\n // A missing answer is a VALIDATION 400 regardless of whether a task is parked\n // — it is a malformed request, not a state conflict.\n this.admitTypedInput(() => {\n if (answer.trim().length === 0) throw new Error('empty answer');\n return answer;\n }, 'An answer is required to resume a parked coding task.');\n const parked = this.parkedCodingSessions.get(taskId);\n if (!parked) {\n throw this.buildDispatchConflictError(\n `No coding task is awaiting an answer under id ${taskId} in this process. `\n + 'A companion restart drops in-flight answerable state; re-dispatch the task instead.',\n );\n }\n return this.resumeParkedCodingTask(parked, answer);\n }\n\n /**\n * Run a resume against an EXPLICIT parked state — from the in-process map or\n * reconstructed from the build plan after a restart.\n *\n * Runs under the worktree mutation lock exactly like a fresh dispatch (a resume\n * mutates the same worktree) and re-enters the turn ladder through\n * `session/load`, so the agent continues with its full context. The mutation\n * scope and verification plan are the parked contract's; a resume is held to the\n * same bounds as the first run.\n */\n public async resumeParkedCodingTask(\n parked: ParkedCodingSessionState,\n answer: string,\n ): Promise<ApplicationCodingTaskRunAdmission> {\n const trimmedAnswer = this.admitTypedInput(() => {\n const value = answer.trim();\n if (value.length === 0) throw new Error('empty answer');\n return value;\n }, 'An answer is required to resume a parked coding task.');\n const taskId = parked.durableTask._id;\n if (!parked.suspension.resumable) {\n throw this.buildDispatchConflictError(\n `Coding task ${taskId} parked on a question, but its agent does not support session resume, `\n + 'so the answer cannot be delivered to the same session. Re-dispatch the task with the answer folded into the objective.',\n );\n }\n if (this.activeRun) {\n throw this.buildDispatchConflictError(\n `A coding-agent run is already active (task ${this.activeRun.taskId}). Answers are serialized behind the same worktree lock.`,\n );\n }\n\n // Taken out of the answerable set for the duration of the resume; a resume\n // that parks again re-registers it through the same suspension branch.\n this.parkedCodingSessions.delete(taskId);\n\n const admission = createDeferred<ApplicationCodingTaskRunAdmission>();\n const resumeRun = withDedicatedFileLock(\n this.getWorkspaceMutationLockPath(),\n async () => {\n this.activeRun = { taskId, startedAt: new Date().toISOString(), abortController: new AbortController() };\n const settlement = createDeferred<void>();\n this.applicationCodingTaskSettlements.set(taskId, { promise: settlement.promise, resolve: () => settlement.resolve(undefined) });\n admission.resolve({\n taskId,\n status: FlowsActors_Status.PROCESSING,\n taskRef: parked.task.taskRef,\n baselineHeadSha: parked.baseline.headSha,\n baselineDirtyFileCount: Object.keys(parked.baseline.files).length,\n });\n try {\n await this.executeApplicationCodingTask(\n parked.task,\n renderApplicationCodingTaskAgentPrompt(parked.task),\n parked.verificationPlans,\n parked.durableTask,\n parked.baseline,\n { continuationOfSessionId: parked.suspension.sessionId, answerPrompt: trimmedAnswer },\n );\n } finally {\n this.activeRun = null;\n this.applicationCodingTaskSettlements.get(taskId)?.resolve();\n }\n },\n { retries: { retries: 0 } },\n );\n resumeRun.catch((error: unknown) => {\n admission.reject(this.mapLockError(error));\n this.logDebug('Application coding-task resume run terminated with error', {\n taskId,\n error: describeCaughtError(error),\n });\n });\n\n return admission.promise;\n }\n\n private buildApplicationCodingTaskTraceSummary(task: ApplicationCodingTaskContract): Record<string, unknown> {\n return {\n taskRef: task.taskRef,\n objectiveRef: task.objectiveRef,\n candidateRef: task.candidateRef,\n mutationScope: task.mutationScope,\n contextPlanRef: task.contextPlan.planRef,\n selectedSourceRefs: task.contextSelection.selectedSources.map((source) => source.sourceRef),\n verificationRef: task.verificationIntent.verificationRef,\n requiredChecks: task.verificationIntent.requiredChecks,\n installedSkillRefs: task.installedSkillRefs,\n };\n }\n\n // ================================================================\n // Verification hook (P-29c — enum vocabulary, never a command string)\n // ================================================================\n\n private buildVerificationPlan(kind: VerificationKind, requestedPath?: string): VerificationPlan {\n if (kind === VerificationKind.VITEST_PATH) {\n const sanitized = this.sanitizeRelativePath(requestedPath ?? '');\n const absoluteTestPath = join(this.companionContext.saasRoot, sanitized);\n const packageDir = this.findNearestPackageDir(dirname(absoluteTestPath));\n return {\n kind,\n path: sanitized,\n command: 'pnpm',\n args: ['exec', 'vitest', 'run', relative(packageDir, absoluteTestPath)],\n cwd: packageDir,\n };\n }\n\n // TYPECHECK — optional path points at a workspace package directory.\n const sanitized = requestedPath ? this.sanitizeRelativePath(requestedPath) : null;\n return {\n kind,\n path: sanitized,\n command: 'pnpm',\n args: ['exec', 'tsc', '--noEmit'],\n cwd: sanitized ? join(this.companionContext.saasRoot, sanitized) : this.companionContext.saasRoot,\n };\n }\n\n /**\n * The FK-resolution sweep, sourced from the `resources-registry` introspection\n * behavior — a FRESH subprocess import of the app's shared-lib, never the\n * companion's boot-time cache, so it judges exactly the bytes the mutation\n * left on disk. Fails the check when any `.isForeignKey()` field has no\n * registered relationship edge: invisible to every typecheck in the plan and\n * to the backend boot, fatal to the app's frontend at first page load\n * (`frontend_fk_resolution_failed` — wonder-crm, 2026-08-27).\n */\n private async runForeignKeyResolutionVerification(): Promise<VerificationOutcome> {\n const backendServiceKey = Object.entries(this.companionContext.servicesByKey)\n .find(([, service]) => !service.frontendType)?.[0];\n if (!backendServiceKey) {\n throw new Error('No backend service is available to run the frontend-fk-resolution verification.');\n }\n const result = await this.introspectionService.requestInfo({\n serviceKey: backendServiceKey,\n behavior: 'resources-registry',\n });\n if (!result.success) {\n throw new Error(`resources-registry introspection failed: ${JSON.stringify(result)}`);\n }\n const unresolved = (result.data as { unresolvableForeignKeyFields?: Array<{ resourceType: string; fieldName: string }> })\n .unresolvableForeignKeyFields ?? [];\n const success = unresolved.length === 0;\n return {\n kind: VerificationKind.FRONTEND_FK_RESOLUTION,\n path: null,\n success,\n message: success\n ? 'every isForeignKey() field resolves through a registered relationship'\n : `${unresolved.length} FK field(s) cannot be resolved to a resource type: `\n + unresolved.map(({ resourceType, fieldName }) => `${resourceType}.${fieldName}`).join(', ')\n + ' — declare a relationship with the corresponding foreignKeyField.',\n stdoutTail: '',\n stderrTail: '',\n };\n }\n\n /**\n * The settings-rail content sweep — the SHELL_PLACEMENT counterpart of the FK sweep,\n * and it exists for the same reason: the defect it catches is invisible to a typecheck.\n *\n * A placement naming a `destinationRef` the engine catalog does not ship is not a type\n * error. `resolveSettingsHubConfig` DROPS it, and the section silently never renders —\n * so a coding task that typo'd a ref passes `check:app-typecheck`, reports verified, and\n * leaves the application missing a settings section nobody is told about.\n *\n * WARNINGS do not fail the check. Only errors do: the verifier reports both severities,\n * and failing a coding task on an advisory would train the lane to ignore its own gate.\n */\n private async runSettingsPlacementContentVerification(): Promise<VerificationOutcome> {\n // Mirrors the FK sweep's resolution, on the other side of the same predicate: that\n // one wants a backend service, this one a FRONTEND service, because the settings rail\n // is authored in the frontend workspace and only that subprocess can import it.\n const frontendServiceKey = Object.entries(this.companionContext.servicesByKey)\n .find(([, service]) => service.frontendType)?.[0];\n if (!frontendServiceKey) {\n throw new Error('No frontend service is available to run the settings-placement-content verification.');\n }\n const result = await this.introspectionService.requestInfo({\n serviceKey: frontendServiceKey,\n behavior: 'settings-placement-content',\n });\n if (!result.success) {\n throw new Error(`settings-placement-content introspection failed: ${JSON.stringify(result)}`);\n }\n const data = result.data as {\n authored?: boolean;\n errors?: Array<{ severity: string; code: string; message: string }>;\n };\n const blocking = (data.errors ?? []).filter((error) => error.severity !== 'warning');\n const success = blocking.length === 0;\n return {\n kind: VerificationKind.SETTINGS_PLACEMENT_CONTENT,\n path: null,\n success,\n message: success\n ? (data.authored === false\n // Not a silent pass: an application with no authored rail has nothing to\n // verify, and saying so is the difference between \"checked and clean\" and\n // \"there was nothing to check\".\n ? 'no settings rail is authored — nothing to verify'\n : 'every authored placement names a destination the engine ships')\n : `${blocking.length} settings-placement error(s): `\n + blocking.map((error) => `${error.code}: ${error.message}`).join(' | '),\n stdoutTail: '',\n stderrTail: '',\n };\n }\n\n /**\n * The schema-plan drift gate — `wildo db diff --check` at the application root.\n *\n * ## Why it is not simply another argv plan\n *\n * The other CLI checks answer a two-valued question about a package that always exists.\n * This one has THREE outcomes, and collapsing any of them into \"failed\" would fail runs\n * on a question nobody asked:\n *\n * 1. **No committed lockfile** — the application has not adopted migrations. Every\n * MongoDB application is permanently in this state (a collection exists on first\n * write; there is no plan to drift from), and a PostgreSQL application is in it until\n * a human commits the initial baseline. `wildo db diff --check` deliberately EXITS\n * NON-ZERO here — correct for a CI ratchet whose baseline is missing, wrong for a\n * gate that runs on every application — so the absence is answered here instead, as\n * a pass that says it checked nothing.\n * 2. **No `backend-api/dist`** — the model is computed by IMPORTING the compiled\n * modules registry, and the build lane only ever runs `tsc --noEmit`, which emits\n * nothing. This is \"we could not ask\", not \"the application has drifted\", so it\n * THROWS and is reported as an infrastructure error. Same distinction this playbook's\n * method already draws for the typechecks, and the same reasoning\n * `reconcileDevelopmentSchemaDrift` uses when it SKIPS on a stale model rather than\n * generating a migration for a model nobody has.\n * 3. **Both present** — the spawn decides, and its own message is carried through: it\n * names the drifted tables and the command that fixes them, which is more than this\n * layer could reconstruct.\n *\n * ## Why the check is worth having at all\n *\n * It is the only check in the catalog that can see a missing table. A resource whose\n * migration was never generated typechecks green in all four packages and then refuses\n * to boot with `postgresql_table_schema_mismatch` — measured 2026-09-07, when an engine\n * resource landed with migrations for two of the three PostgreSQL-backed applications\n * and the third crash-looped until a human read the log.\n */\n private async runSchemaPlanDriftVerification(): Promise<VerificationOutcome> {\n const saasRoot = this.companionContext.saasRoot;\n const lockfilePath = join(saasRoot, 'backend-api', 'migrations', 'schema-plan.lock.json');\n if (!existsSync(lockfilePath)) {\n return {\n kind: VerificationKind.SCHEMA_PLAN_DRIFT,\n path: null,\n success: true,\n // Says it checked NOTHING rather than reporting a clean plan — the same honesty the\n // settings-placement sweep applies to an application with no authored rail.\n message: 'no schema-plan lockfile — this application has not adopted migrations, so there is no accepted plan to drift from (every MongoDB application is in this state permanently)',\n stdoutTail: '',\n stderrTail: '',\n };\n }\n\n const modulesRegistryPath = join(saasRoot, 'backend-api', 'dist', 'modules-registry.backend.js');\n if (!existsSync(modulesRegistryPath)) {\n // THROWN on purpose: `executeVerificationPlans` classifies a throw as an infrastructure\n // error and reports it apart from a failing check. A `success: false` here would say the\n // application has drifted, which is a claim about a model that was never computed.\n throw new Error(\n `Cannot check schema-plan drift: ${modulesRegistryPath} does not exist. The plan is computed by importing `\n + \"the compiled backend registry, and this build never emitted one (`tsc --noEmit` does not). Build backend-api, \"\n + 'or run this check under `wildo local dev`, whose watcher maintains that dist.',\n );\n }\n\n const outcome = await this.runVerification({\n kind: VerificationKind.SCHEMA_PLAN_DRIFT,\n path: null,\n command: 'wildo',\n args: ['db', 'diff', '--check'],\n cwd: saasRoot,\n });\n if (!outcome.success && /ENOENT|not found/i.test(outcome.message)) {\n // The CLI is a GLOBAL install (`platform/factory/scripts/install.sh`) and is not linked\n // into an application's `node_modules/.bin` — verified on both dogfood applications. So\n // \"wildo is not on PATH\" is an absent tool, never a drifted schema.\n throw new Error(`Cannot check schema-plan drift: the \\`wildo\\` CLI could not be executed (${outcome.message}).`);\n }\n return outcome;\n }\n\n /**\n * Run a resolved verification plan set and return one outcome per check.\n *\n * Extracted from the coding-task dispatch so the SAME executor serves a second caller: the\n * `DETERMINISTIC_CLI` playbook tier, which verifies an already-built application and dispatches no\n * agent (issue #147). The alternative was a second loop that re-derived which kinds branch away\n * from the argv path — and the two would drift the first time a `VerificationKind` was added,\n * silently, because a missed kind falls through to a typecheck that passes.\n *\n * A thrown error is an INFRASTRUCTURE failure, not a failing check: the subprocess could not be\n * run at all. It is recorded as a failed outcome so the caller sees which check was affected, and\n * surfaced separately so a caller can tell \"the application is broken\" from \"we could not ask\".\n */\n private async executeVerificationPlans(\n plans: readonly ApplicationCodingTaskVerificationPlan[],\n ): Promise<{\n verification: Array<{ checkRef: string; outcome: VerificationOutcome }>;\n infrastructureError: unknown;\n }> {\n const verification: Array<{ checkRef: string; outcome: VerificationOutcome }> = [];\n let infrastructureError: unknown = null;\n for (const plan of plans) {\n try {\n verification.push({\n checkRef: plan.checkRef,\n // The FK-resolution check is not a CLI command: it runs in the companion's\n // introspection subprocess (fresh working-tree import), so it branches before\n // the argv-plan path.\n outcome: plan.kind === VerificationKind.FRONTEND_FK_RESOLUTION\n ? await this.runForeignKeyResolutionVerification()\n : plan.kind === VerificationKind.SETTINGS_PLACEMENT_CONTENT\n ? await this.runSettingsPlacementContentVerification()\n : plan.kind === VerificationKind.SCHEMA_PLAN_DRIFT\n ? await this.runSchemaPlanDriftVerification()\n : await this.runVerification(this.buildVerificationPlan(plan.kind, plan.path ?? undefined)),\n });\n } catch (error) {\n infrastructureError ??= error;\n verification.push({\n checkRef: plan.checkRef,\n outcome: {\n kind: plan.kind,\n path: plan.path,\n success: false,\n message: describeCaughtError(error),\n stdoutTail: '',\n stderrTail: '',\n },\n });\n }\n }\n return { verification, infrastructureError };\n }\n\n /**\n * Run named verification checks against the application, outside any agent dispatch.\n *\n * The public door for the `DETERMINISTIC_CLI` tier. Check refs resolve through the same closed\n * `APPLICATION_CODING_TASK_VERIFICATION_CATALOG` a coding task uses, so an unknown ref is refused\n * here rather than becoming an unrun check that reports success by absence.\n *\n * Deliberately takes NO worktree lock and captures NO change set: this reads the application, and\n * pretending otherwise would serialize verification against the single-flight coding lane for no\n * reason.\n */\n public async runApplicationVerificationChecks(\n checkRefs: readonly string[],\n ): Promise<{\n verification: Array<{ checkRef: string; outcome: VerificationOutcome }>;\n infrastructureError: unknown;\n }> {\n return this.executeVerificationPlans(resolveApplicationCodingTaskVerificationPlans(checkRefs));\n }\n\n private async runVerification(plan: VerificationPlan): Promise<VerificationOutcome> {\n try {\n const result = await executeBoundedSubprocess({\n command: plan.command,\n args: plan.args,\n cwd: plan.cwd,\n env: buildVerificationEnv(),\n timeoutMs: VERIFICATION_TIMEOUT_MS,\n maxCapturedBytes: VERIFICATION_MAX_CAPTURED_BYTES,\n });\n return {\n kind: plan.kind,\n path: plan.path,\n success: true,\n message: `${plan.command} ${plan.args.join(' ')} passed`,\n stdoutTail: result.stdout.slice(-OUTPUT_TAIL_CHARS),\n stderrTail: result.stderr.slice(-OUTPUT_TAIL_CHARS),\n };\n } catch (error) {\n const details = (error as { details?: { stdout?: string; stderr?: string } }).details;\n return {\n kind: plan.kind,\n path: plan.path,\n success: false,\n message: describeCaughtError(error),\n stdoutTail: (details?.stdout ?? '').slice(-OUTPUT_TAIL_CHARS),\n stderrTail: (details?.stderr ?? '').slice(-OUTPUT_TAIL_CHARS),\n };\n }\n }\n\n /**\n * Run one admission-time validation and convert ANY refusal into a typed\n * VALIDATION error, preserving the original message as context.\n *\n * Deliberately a wrapper rather than N rewritten throw sites: the pure\n * resolver in the models layer has no error builder and should not grow one,\n * and a future admission check gets the same classification by being placed\n * here rather than by remembering to.\n */\n private admitTypedInput<T>(validate: () => T, message: string): T {\n try {\n return validate();\n } catch (error) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message,\n validationError: describeCaughtError(error),\n },\n });\n }\n }\n\n /**\n * Sanitize an app-root-relative path from the wire: rejects absolute\n * paths, `..` escapes, backslashes, NUL bytes, and flag-lookalikes\n * (leading `-` would be parsed as an argv flag by the fixed commands).\n */\n private sanitizeRelativePath(requestedPath: string): string {\n const candidate = requestedPath.trim();\n const reject = (reason: string): never => {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message: `Invalid verification path: ${reason}`,\n requestedPath,\n },\n });\n };\n\n if (!candidate) reject('path is empty');\n if (candidate.includes('\\0')) reject('path contains a NUL byte');\n if (candidate.includes('\\\\')) reject('use forward slashes');\n if (isAbsolute(candidate)) reject('path must be relative to the application root');\n if (candidate.startsWith('-')) reject('path must not start with a dash');\n const normalized = normalize(candidate);\n if (normalized.split(sep).includes('..')) reject('path must not escape the application root');\n\n const absolute = join(this.companionContext.saasRoot, normalized);\n const relativeFromRoot = relative(this.companionContext.saasRoot, absolute);\n if (relativeFromRoot.startsWith('..') || isAbsolute(relativeFromRoot)) {\n reject('path resolves outside the application root');\n }\n return normalized;\n }\n\n /** Nearest ancestor dir (within the app root) holding a package.json. */\n private findNearestPackageDir(startDir: string): string {\n let current = startDir;\n const root = this.companionContext.saasRoot;\n while (current.startsWith(root)) {\n if (existsSync(join(current, 'package.json'))) {\n return current;\n }\n const parent = dirname(current);\n if (parent === current) break;\n current = parent;\n }\n return root;\n }\n\n // ================================================================\n // Error + traceability helpers (service-owned wrappers, P-13 pattern)\n // ================================================================\n\n private buildDispatchConflictError(message: string): unknown {\n return this.errorBuilder.buildError(ErrorType.CONFLICT, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFLICT,\n context: { message },\n });\n }\n\n /** Map proper-lockfile ELOCKED contention onto the 409 vocabulary. */\n private mapLockError(error: unknown): unknown {\n if ((error as { code?: string })?.code === 'ELOCKED') {\n return this.buildDispatchConflictError(\n 'The workspace-mutation lock is held by another process (companion run or CLI). '\n + 'Dispatch is single-flight across processes (P-20); retry after the active run completes. '\n + 'If you are a dispatched coding-agent run: dispatching from a dispatched run is forbidden (P-35).',\n );\n }\n return error;\n }\n\n private createOperationTraceStep(\n sessionContext: CompanionExecutionSessionContext | undefined,\n label: string,\n ) {\n return sessionContext\n ? this.traceabilityService.createStep(sessionContext, {\n kind: 'coding-agent-dispatch',\n label,\n })\n : undefined;\n }\n\n private async traceOperationStart(input: {\n sessionContext?: CompanionExecutionSessionContext;\n step?: ReturnType<CompanionTraceabilityService['createStep']>;\n type: string;\n summary: string;\n payload?: unknown;\n artifactFileName?: string;\n artifactContent?: unknown;\n }): Promise<void> {\n if (!input.sessionContext) return;\n\n await this.traceabilityService.traceEvent({\n session: input.sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG,\n type: input.type,\n summary: input.summary,\n ...(input.payload !== undefined ? { payload: input.payload } : {}),\n ...(input.step ? { step: input.step } : {}),\n });\n if (input.artifactFileName && input.artifactContent !== undefined) {\n await this.traceabilityService.writeArtifact({\n session: input.sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG_VERBOSE,\n fileName: input.artifactFileName,\n content: input.artifactContent,\n ...(input.step ? { step: input.step } : {}),\n });\n }\n }\n\n private async traceOperationSuccess(input: {\n sessionContext?: CompanionExecutionSessionContext;\n step?: ReturnType<CompanionTraceabilityService['createStep']>;\n type: string;\n summary: string;\n payload?: unknown;\n artifactFileName?: string;\n artifactContent?: unknown;\n }): Promise<void> {\n if (!input.sessionContext) return;\n\n if (input.artifactFileName && input.artifactContent !== undefined) {\n await this.traceabilityService.writeArtifact({\n session: input.sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG_VERBOSE,\n fileName: input.artifactFileName,\n content: input.artifactContent,\n ...(input.step ? { step: input.step } : {}),\n });\n }\n await this.traceabilityService.traceEvent({\n session: input.sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG,\n type: input.type,\n summary: input.summary,\n ...(input.payload !== undefined ? { payload: input.payload } : {}),\n ...(input.step ? { step: input.step } : {}),\n });\n }\n\n private async traceOperationFailure(input: {\n sessionContext?: CompanionExecutionSessionContext;\n step?: ReturnType<CompanionTraceabilityService['createStep']>;\n type: string;\n summary: string;\n error: unknown;\n payload?: unknown;\n }): Promise<void> {\n if (!input.sessionContext) return;\n\n await this.traceabilityService.traceEvent({\n session: input.sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG,\n type: input.type,\n summary: input.summary,\n payload: {\n ...(input.payload && typeof input.payload === 'object'\n ? input.payload as Record<string, unknown>\n : { input: input.payload }),\n error: buildOutputErrorPayload(input.error),\n },\n ...(input.step ? { step: input.step } : {}),\n });\n }\n\n private async traceOperationArtifact(\n sessionContext: CompanionExecutionSessionContext | undefined,\n step: ReturnType<CompanionTraceabilityService['createStep']> | undefined,\n fileName: string,\n content: unknown,\n ): Promise<void> {\n if (!sessionContext) return;\n await this.traceabilityService.writeArtifact({\n session: sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG_VERBOSE,\n fileName,\n content,\n ...(step ? { step } : {}),\n });\n }\n}\n\ninterface VerificationPlan {\n kind: VerificationKind;\n path: string | null;\n command: string;\n args: string[];\n cwd: string;\n}\n\n/**\n * Change-set artifact persisted on the task row (P-19: file list + stats\n * + head SHAs + attribution classes). `fullDiffText` is deliberately\n * stripped — the raw diff lives in the traceability artifact only.\n *\n * Persisted as `FlowsActors_IO_PartKind.STRUCTURED` with the capture in\n * `content.data`. History: on 2026-07-03 this was temporarily JSON-encoded\n * into a TEXT artifact because the zod-to-mongoose converter flattened\n * nested discriminated unions (`artifacts[]` on the task row) onto their\n * FIRST variant, making `content.text` a required Mongoose path for every\n * artifact. The converter now merges nested union variants into an\n * all-optional superset schema, so the natural STRUCTURED shape persists\n * again (requires a saas-backend-lib dist carrying that fix).\n */\nfunction buildChangeSetArtifact(taskId: string, changeSet: GitChangeSetCapture): ArtifactInstance {\n const { fullDiffText: _fullDiffText, ...structuredCapture } = changeSet;\n return {\n ref: `coding-agent-change-set-${taskId}`,\n type: FlowsActors_IO_PartKind.STRUCTURED,\n name: 'coding-agent-change-set',\n description: 'Read-only git change-set capture with per-file attribution (P-19)',\n origin: { taskId },\n content: { data: structuredCapture },\n createdAt: new Date().toISOString(),\n };\n}\n\n/** Same minimal allowlist the CLI spawn uses (P-18). */\nfunction buildVerificationEnv(): NodeJS.ProcessEnv {\n // Same minimal identity allowlist the CLI spawn uses (P-18) — incl.\n // USER/LOGNAME so a verification hook that shells out to per-user\n // tooling behaves like the agent run. Kept in lockstep with\n // `ClaudeCliCompanionService`'s allowlist.\n const env: NodeJS.ProcessEnv = {};\n for (const key of ['PATH', 'HOME', 'USER', 'LOGNAME', 'SHELL', 'TERM']) {\n const value = process.env[key];\n if (value !== undefined) env[key] = value;\n }\n return env;\n}\n\nfunction buildOutputErrorPayload(error: unknown): unknown {\n if (isWildoBackendError(error)) return error;\n if (error instanceof Error) {\n return {\n message: error.message,\n name: error.name,\n ...(error.stack ? { stack: error.stack } : {}),\n };\n }\n return { message: String(error) };\n}\n\nfunction createDeferred<T>(): {\n promise: Promise<T>;\n resolve: (value: T) => void;\n reject: (error: unknown) => void;\n} {\n let settled = false;\n let resolveFn!: (value: T) => void;\n let rejectFn!: (error: unknown) => void;\n const promise = new Promise<T>((resolve, reject) => {\n resolveFn = resolve;\n rejectFn = reject;\n });\n return {\n promise,\n resolve: (value) => {\n if (settled) return;\n settled = true;\n resolveFn(value);\n },\n reject: (error) => {\n if (settled) return;\n settled = true;\n rejectFn(error);\n },\n };\n}\n"]}