@exellix/ai-tasks 7.8.0

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 (524) hide show
  1. package/.env.example +3 -0
  2. package/.metadata/instructions-builders/create-expected-output-instructions.md +195 -0
  3. package/.metadata/readme.md +48 -0
  4. package/.metadata/shared/audit.md +29 -0
  5. package/.metadata/skills/professional-answer +32 -0
  6. package/.metadata/skills/professional-answer.compressed.md +11 -0
  7. package/.metadata/skills/professional-answer.instructions +33 -0
  8. package/.metadata/skills/professional-answer.instructions.md +33 -0
  9. package/.metadata/skills/professional-answer.l2.md +28 -0
  10. package/.metadata/skills/professional-answer.md +32 -0
  11. package/.metadata/skills/professional-answer.prompt +1 -0
  12. package/.metadata/skills/professional-answer.prompt.md +1 -0
  13. package/.metadata/skills/professional-decision.md +26 -0
  14. package/BREAKING-CHANGES.md +43 -0
  15. package/CHANGELOG.md +147 -0
  16. package/README.md +2497 -0
  17. package/RUNTASK_REQUEST.md +369 -0
  18. package/dist/activix/activixClient.d.ts +6 -0
  19. package/dist/activix/activixClient.d.ts.map +1 -0
  20. package/dist/activix/activixClient.js +131 -0
  21. package/dist/activix/activixClient.js.map +1 -0
  22. package/dist/activix/getTaskActivities.d.ts +10 -0
  23. package/dist/activix/getTaskActivities.d.ts.map +1 -0
  24. package/dist/activix/getTaskActivities.js +17 -0
  25. package/dist/activix/getTaskActivities.js.map +1 -0
  26. package/dist/activix/phaseTracking.d.ts +17 -0
  27. package/dist/activix/phaseTracking.d.ts.map +1 -0
  28. package/dist/activix/phaseTracking.js +85 -0
  29. package/dist/activix/phaseTracking.js.map +1 -0
  30. package/dist/aiScoping/index.d.ts +6 -0
  31. package/dist/aiScoping/index.d.ts.map +1 -0
  32. package/dist/aiScoping/index.js +4 -0
  33. package/dist/aiScoping/index.js.map +1 -0
  34. package/dist/aiScoping/runAiScoping.d.ts +36 -0
  35. package/dist/aiScoping/runAiScoping.d.ts.map +1 -0
  36. package/dist/aiScoping/runAiScoping.js +100 -0
  37. package/dist/aiScoping/runAiScoping.js.map +1 -0
  38. package/dist/aiScoping/runScopingCall.d.ts +23 -0
  39. package/dist/aiScoping/runScopingCall.d.ts.map +1 -0
  40. package/dist/aiScoping/runScopingCall.js +50 -0
  41. package/dist/aiScoping/runScopingCall.js.map +1 -0
  42. package/dist/aiScoping/validateAiScoping.d.ts +7 -0
  43. package/dist/aiScoping/validateAiScoping.d.ts.map +1 -0
  44. package/dist/aiScoping/validateAiScoping.js +33 -0
  45. package/dist/aiScoping/validateAiScoping.js.map +1 -0
  46. package/dist/aiSkillsUpstreamExports.d.ts +13 -0
  47. package/dist/aiSkillsUpstreamExports.d.ts.map +1 -0
  48. package/dist/aiSkillsUpstreamExports.js +12 -0
  49. package/dist/aiSkillsUpstreamExports.js.map +1 -0
  50. package/dist/analysis/analyzeRunTaskRequest.d.ts +29 -0
  51. package/dist/analysis/analyzeRunTaskRequest.d.ts.map +1 -0
  52. package/dist/analysis/analyzeRunTaskRequest.js +85 -0
  53. package/dist/analysis/analyzeRunTaskRequest.js.map +1 -0
  54. package/dist/analysis/index.d.ts +3 -0
  55. package/dist/analysis/index.d.ts.map +1 -0
  56. package/dist/analysis/index.js +2 -0
  57. package/dist/analysis/index.js.map +1 -0
  58. package/dist/builders/task-request-builder.d.ts +310 -0
  59. package/dist/builders/task-request-builder.d.ts.map +1 -0
  60. package/dist/builders/task-request-builder.js +581 -0
  61. package/dist/builders/task-request-builder.js.map +1 -0
  62. package/dist/compile/compileTaskConfiguration.d.ts +15 -0
  63. package/dist/compile/compileTaskConfiguration.d.ts.map +1 -0
  64. package/dist/compile/compileTaskConfiguration.js +184 -0
  65. package/dist/compile/compileTaskConfiguration.js.map +1 -0
  66. package/dist/compile/index.d.ts +2 -0
  67. package/dist/compile/index.d.ts.map +1 -0
  68. package/dist/compile/index.js +2 -0
  69. package/dist/compile/index.js.map +1 -0
  70. package/dist/core/task-sdk.d.ts +36 -0
  71. package/dist/core/task-sdk.d.ts.map +1 -0
  72. package/dist/core/task-sdk.js +2432 -0
  73. package/dist/core/task-sdk.js.map +1 -0
  74. package/dist/errors/smartInputValidationError.d.ts +39 -0
  75. package/dist/errors/smartInputValidationError.d.ts.map +1 -0
  76. package/dist/errors/smartInputValidationError.js +97 -0
  77. package/dist/errors/smartInputValidationError.js.map +1 -0
  78. package/dist/errors/taskConfigurationCompileError.d.ts +16 -0
  79. package/dist/errors/taskConfigurationCompileError.d.ts.map +1 -0
  80. package/dist/errors/taskConfigurationCompileError.js +20 -0
  81. package/dist/errors/taskConfigurationCompileError.js.map +1 -0
  82. package/dist/execution-strategies/applyExecutionStrategyOutputs.d.ts +17 -0
  83. package/dist/execution-strategies/applyExecutionStrategyOutputs.d.ts.map +1 -0
  84. package/dist/execution-strategies/applyExecutionStrategyOutputs.js +63 -0
  85. package/dist/execution-strategies/applyExecutionStrategyOutputs.js.map +1 -0
  86. package/dist/execution-strategies/constants.d.ts +14 -0
  87. package/dist/execution-strategies/constants.d.ts.map +1 -0
  88. package/dist/execution-strategies/constants.js +13 -0
  89. package/dist/execution-strategies/constants.js.map +1 -0
  90. package/dist/execution-strategies/executionStrategyCatalogMetadata.d.ts +9 -0
  91. package/dist/execution-strategies/executionStrategyCatalogMetadata.d.ts.map +1 -0
  92. package/dist/execution-strategies/executionStrategyCatalogMetadata.js +37 -0
  93. package/dist/execution-strategies/executionStrategyCatalogMetadata.js.map +1 -0
  94. package/dist/execution-strategies/genericExecutionFuncxEnvelope.d.ts +94 -0
  95. package/dist/execution-strategies/genericExecutionFuncxEnvelope.d.ts.map +1 -0
  96. package/dist/execution-strategies/genericExecutionFuncxEnvelope.js +306 -0
  97. package/dist/execution-strategies/genericExecutionFuncxEnvelope.js.map +1 -0
  98. package/dist/execution-strategies/resolveExecutionStrategies.d.ts +14 -0
  99. package/dist/execution-strategies/resolveExecutionStrategies.d.ts.map +1 -0
  100. package/dist/execution-strategies/resolveExecutionStrategies.js +108 -0
  101. package/dist/execution-strategies/resolveExecutionStrategies.js.map +1 -0
  102. package/dist/execution-strategies/runFuncxExecutionStrategy.d.ts +37 -0
  103. package/dist/execution-strategies/runFuncxExecutionStrategy.d.ts.map +1 -0
  104. package/dist/execution-strategies/runFuncxExecutionStrategy.js +72 -0
  105. package/dist/execution-strategies/runFuncxExecutionStrategy.js.map +1 -0
  106. package/dist/index.d.ts +99 -0
  107. package/dist/index.d.ts.map +1 -0
  108. package/dist/index.js +106 -0
  109. package/dist/index.js.map +1 -0
  110. package/dist/internal/resolveLlmCallForXynthesis.d.ts +52 -0
  111. package/dist/internal/resolveLlmCallForXynthesis.d.ts.map +1 -0
  112. package/dist/internal/resolveLlmCallForXynthesis.js +81 -0
  113. package/dist/internal/resolveLlmCallForXynthesis.js.map +1 -0
  114. package/dist/internal/resolveRunTaskRuntimeKnobs.d.ts +19 -0
  115. package/dist/internal/resolveRunTaskRuntimeKnobs.d.ts.map +1 -0
  116. package/dist/internal/resolveRunTaskRuntimeKnobs.js +52 -0
  117. package/dist/internal/resolveRunTaskRuntimeKnobs.js.map +1 -0
  118. package/dist/internal/runPostStepLlmCall.d.ts +52 -0
  119. package/dist/internal/runPostStepLlmCall.d.ts.map +1 -0
  120. package/dist/internal/runPostStepLlmCall.js +170 -0
  121. package/dist/internal/runPostStepLlmCall.js.map +1 -0
  122. package/dist/localTasks/collectEvidence.d.ts +3 -0
  123. package/dist/localTasks/collectEvidence.d.ts.map +1 -0
  124. package/dist/localTasks/collectEvidence.js +364 -0
  125. package/dist/localTasks/collectEvidence.js.map +1 -0
  126. package/dist/localTasks/decideWebScope.d.ts +3 -0
  127. package/dist/localTasks/decideWebScope.d.ts.map +1 -0
  128. package/dist/localTasks/decideWebScope.js +56 -0
  129. package/dist/localTasks/decideWebScope.js.map +1 -0
  130. package/dist/localTasks/index.d.ts +5 -0
  131. package/dist/localTasks/index.d.ts.map +1 -0
  132. package/dist/localTasks/index.js +19 -0
  133. package/dist/localTasks/index.js.map +1 -0
  134. package/dist/localTasks/narrixAssetPlayground.d.ts +13 -0
  135. package/dist/localTasks/narrixAssetPlayground.d.ts.map +1 -0
  136. package/dist/localTasks/narrixAssetPlayground.js +161 -0
  137. package/dist/localTasks/narrixAssetPlayground.js.map +1 -0
  138. package/dist/localTasks/narrixSubnetPlayground.d.ts +14 -0
  139. package/dist/localTasks/narrixSubnetPlayground.d.ts.map +1 -0
  140. package/dist/localTasks/narrixSubnetPlayground.js +168 -0
  141. package/dist/localTasks/narrixSubnetPlayground.js.map +1 -0
  142. package/dist/localTasks/narrixVulnGroupPlayground.d.ts +13 -0
  143. package/dist/localTasks/narrixVulnGroupPlayground.d.ts.map +1 -0
  144. package/dist/localTasks/narrixVulnGroupPlayground.js +161 -0
  145. package/dist/localTasks/narrixVulnGroupPlayground.js.map +1 -0
  146. package/dist/localTasks/narrixVulnInstancePlayground.d.ts +13 -0
  147. package/dist/localTasks/narrixVulnInstancePlayground.d.ts.map +1 -0
  148. package/dist/localTasks/narrixVulnInstancePlayground.js +165 -0
  149. package/dist/localTasks/narrixVulnInstancePlayground.js.map +1 -0
  150. package/dist/localTasks/nodeCallExport.d.ts +6 -0
  151. package/dist/localTasks/nodeCallExport.d.ts.map +1 -0
  152. package/dist/localTasks/nodeCallExport.js +99 -0
  153. package/dist/localTasks/nodeCallExport.js.map +1 -0
  154. package/dist/localTasks/nodeCallExportBatch.d.ts +3 -0
  155. package/dist/localTasks/nodeCallExportBatch.d.ts.map +1 -0
  156. package/dist/localTasks/nodeCallExportBatch.js +52 -0
  157. package/dist/localTasks/nodeCallExportBatch.js.map +1 -0
  158. package/dist/localTasks/normalizeNarrixResult.d.ts +3 -0
  159. package/dist/localTasks/normalizeNarrixResult.d.ts.map +1 -0
  160. package/dist/localTasks/normalizeNarrixResult.js +106 -0
  161. package/dist/localTasks/normalizeNarrixResult.js.map +1 -0
  162. package/dist/localTasks/registry.d.ts +4 -0
  163. package/dist/localTasks/registry.d.ts.map +1 -0
  164. package/dist/localTasks/registry.js +8 -0
  165. package/dist/localTasks/registry.js.map +1 -0
  166. package/dist/localTasks/types.d.ts +28 -0
  167. package/dist/localTasks/types.d.ts.map +1 -0
  168. package/dist/localTasks/types.js +2 -0
  169. package/dist/localTasks/types.js.map +1 -0
  170. package/dist/localTasks/validateInput.d.ts +3 -0
  171. package/dist/localTasks/validateInput.d.ts.map +1 -0
  172. package/dist/localTasks/validateInput.js +66 -0
  173. package/dist/localTasks/validateInput.js.map +1 -0
  174. package/dist/methods/convenience-methods.d.ts +45 -0
  175. package/dist/methods/convenience-methods.d.ts.map +1 -0
  176. package/dist/methods/convenience-methods.js +39 -0
  177. package/dist/methods/convenience-methods.js.map +1 -0
  178. package/dist/narrix/applyNarrixScope.d.ts +10 -0
  179. package/dist/narrix/applyNarrixScope.d.ts.map +1 -0
  180. package/dist/narrix/applyNarrixScope.js +69 -0
  181. package/dist/narrix/applyNarrixScope.js.map +1 -0
  182. package/dist/narrix/buildNarrixAttachment.d.ts +9 -0
  183. package/dist/narrix/buildNarrixAttachment.d.ts.map +1 -0
  184. package/dist/narrix/buildNarrixAttachment.js +29 -0
  185. package/dist/narrix/buildNarrixAttachment.js.map +1 -0
  186. package/dist/narrix/buildWebScopeScopeInput.d.ts +39 -0
  187. package/dist/narrix/buildWebScopeScopeInput.d.ts.map +1 -0
  188. package/dist/narrix/buildWebScopeScopeInput.js +193 -0
  189. package/dist/narrix/buildWebScopeScopeInput.js.map +1 -0
  190. package/dist/narrix/flags.d.ts +4 -0
  191. package/dist/narrix/flags.d.ts.map +1 -0
  192. package/dist/narrix/flags.js +4 -0
  193. package/dist/narrix/flags.js.map +1 -0
  194. package/dist/narrix/index.d.ts +11 -0
  195. package/dist/narrix/index.d.ts.map +1 -0
  196. package/dist/narrix/index.js +14 -0
  197. package/dist/narrix/index.js.map +1 -0
  198. package/dist/narrix/narrixClient.d.ts +9 -0
  199. package/dist/narrix/narrixClient.d.ts.map +1 -0
  200. package/dist/narrix/narrixClient.js +46 -0
  201. package/dist/narrix/narrixClient.js.map +1 -0
  202. package/dist/narrix/narrixContextMarkdown.d.ts +15 -0
  203. package/dist/narrix/narrixContextMarkdown.d.ts.map +1 -0
  204. package/dist/narrix/narrixContextMarkdown.js +98 -0
  205. package/dist/narrix/narrixContextMarkdown.js.map +1 -0
  206. package/dist/narrix/narrixRunnerModule.d.ts +11 -0
  207. package/dist/narrix/narrixRunnerModule.d.ts.map +1 -0
  208. package/dist/narrix/narrixRunnerModule.js +17 -0
  209. package/dist/narrix/narrixRunnerModule.js.map +1 -0
  210. package/dist/narrix/runNarrixForChat.d.ts +3 -0
  211. package/dist/narrix/runNarrixForChat.d.ts.map +1 -0
  212. package/dist/narrix/runNarrixForChat.js +51 -0
  213. package/dist/narrix/runNarrixForChat.js.map +1 -0
  214. package/dist/narrix/runNarrixForDocs.d.ts +3 -0
  215. package/dist/narrix/runNarrixForDocs.d.ts.map +1 -0
  216. package/dist/narrix/runNarrixForDocs.js +50 -0
  217. package/dist/narrix/runNarrixForDocs.js.map +1 -0
  218. package/dist/narrix/runNarrixForRecord.d.ts +3 -0
  219. package/dist/narrix/runNarrixForRecord.d.ts.map +1 -0
  220. package/dist/narrix/runNarrixForRecord.js +47 -0
  221. package/dist/narrix/runNarrixForRecord.js.map +1 -0
  222. package/dist/narrix/runNarrixForText.d.ts +3 -0
  223. package/dist/narrix/runNarrixForText.d.ts.map +1 -0
  224. package/dist/narrix/runNarrixForText.js +49 -0
  225. package/dist/narrix/runNarrixForText.js.map +1 -0
  226. package/dist/narrix/runnerDispatch.d.ts +12 -0
  227. package/dist/narrix/runnerDispatch.d.ts.map +1 -0
  228. package/dist/narrix/runnerDispatch.js +19 -0
  229. package/dist/narrix/runnerDispatch.js.map +1 -0
  230. package/dist/narrix/seedBundleRouting.d.ts +15 -0
  231. package/dist/narrix/seedBundleRouting.d.ts.map +1 -0
  232. package/dist/narrix/seedBundleRouting.js +46 -0
  233. package/dist/narrix/seedBundleRouting.js.map +1 -0
  234. package/dist/narrix/task.d.ts +4 -0
  235. package/dist/narrix/task.d.ts.map +1 -0
  236. package/dist/narrix/task.js +143 -0
  237. package/dist/narrix/task.js.map +1 -0
  238. package/dist/narrix/types.d.ts +104 -0
  239. package/dist/narrix/types.d.ts.map +1 -0
  240. package/dist/narrix/types.js +3 -0
  241. package/dist/narrix/types.js.map +1 -0
  242. package/dist/narrix/webContextMarkdown.d.ts +54 -0
  243. package/dist/narrix/webContextMarkdown.d.ts.map +1 -0
  244. package/dist/narrix/webContextMarkdown.js +206 -0
  245. package/dist/narrix/webContextMarkdown.js.map +1 -0
  246. package/dist/narrix/webScoper.d.ts +43 -0
  247. package/dist/narrix/webScoper.d.ts.map +1 -0
  248. package/dist/narrix/webScoper.js +144 -0
  249. package/dist/narrix/webScoper.js.map +1 -0
  250. package/dist/observability/debugTrace.d.ts +31 -0
  251. package/dist/observability/debugTrace.d.ts.map +1 -0
  252. package/dist/observability/debugTrace.js +117 -0
  253. package/dist/observability/debugTrace.js.map +1 -0
  254. package/dist/observability/extractAiTasksObservability.d.ts +7 -0
  255. package/dist/observability/extractAiTasksObservability.d.ts.map +1 -0
  256. package/dist/observability/extractAiTasksObservability.js +98 -0
  257. package/dist/observability/extractAiTasksObservability.js.map +1 -0
  258. package/dist/observability/graphExecutionRunLogContract.d.ts +19 -0
  259. package/dist/observability/graphExecutionRunLogContract.d.ts.map +1 -0
  260. package/dist/observability/graphExecutionRunLogContract.js +11 -0
  261. package/dist/observability/graphExecutionRunLogContract.js.map +1 -0
  262. package/dist/packaged-tasks-client.d.ts +66 -0
  263. package/dist/packaged-tasks-client.d.ts.map +1 -0
  264. package/dist/packaged-tasks-client.js +100 -0
  265. package/dist/packaged-tasks-client.js.map +1 -0
  266. package/dist/planWebScopeQuestions/index.d.ts +78 -0
  267. package/dist/planWebScopeQuestions/index.d.ts.map +1 -0
  268. package/dist/planWebScopeQuestions/index.js +282 -0
  269. package/dist/planWebScopeQuestions/index.js.map +1 -0
  270. package/dist/planWebScopeQuestions/runResearchPlanQuestionsFuncx.d.ts +18 -0
  271. package/dist/planWebScopeQuestions/runResearchPlanQuestionsFuncx.d.ts.map +1 -0
  272. package/dist/planWebScopeQuestions/runResearchPlanQuestionsFuncx.js +42 -0
  273. package/dist/planWebScopeQuestions/runResearchPlanQuestionsFuncx.js.map +1 -0
  274. package/dist/post-steps/audit/loadAuditTemplates.d.ts +72 -0
  275. package/dist/post-steps/audit/loadAuditTemplates.d.ts.map +1 -0
  276. package/dist/post-steps/audit/loadAuditTemplates.js +62 -0
  277. package/dist/post-steps/audit/loadAuditTemplates.js.map +1 -0
  278. package/dist/post-steps/audit/parseAuditOutput.d.ts +11 -0
  279. package/dist/post-steps/audit/parseAuditOutput.d.ts.map +1 -0
  280. package/dist/post-steps/audit/parseAuditOutput.js +50 -0
  281. package/dist/post-steps/audit/parseAuditOutput.js.map +1 -0
  282. package/dist/post-steps/audit/runAudit.d.ts +22 -0
  283. package/dist/post-steps/audit/runAudit.d.ts.map +1 -0
  284. package/dist/post-steps/audit/runAudit.js +406 -0
  285. package/dist/post-steps/audit/runAudit.js.map +1 -0
  286. package/dist/post-steps/audit/runAuditCall.d.ts +23 -0
  287. package/dist/post-steps/audit/runAuditCall.d.ts.map +1 -0
  288. package/dist/post-steps/audit/runAuditCall.js +32 -0
  289. package/dist/post-steps/audit/runAuditCall.js.map +1 -0
  290. package/dist/post-steps/polish/loadPolishTemplates.d.ts +35 -0
  291. package/dist/post-steps/polish/loadPolishTemplates.d.ts.map +1 -0
  292. package/dist/post-steps/polish/loadPolishTemplates.js +38 -0
  293. package/dist/post-steps/polish/loadPolishTemplates.js.map +1 -0
  294. package/dist/post-steps/polish/parsePolishOutput.d.ts +6 -0
  295. package/dist/post-steps/polish/parsePolishOutput.d.ts.map +1 -0
  296. package/dist/post-steps/polish/parsePolishOutput.js +47 -0
  297. package/dist/post-steps/polish/parsePolishOutput.js.map +1 -0
  298. package/dist/post-steps/polish/runPolish.d.ts +24 -0
  299. package/dist/post-steps/polish/runPolish.d.ts.map +1 -0
  300. package/dist/post-steps/polish/runPolish.js +147 -0
  301. package/dist/post-steps/polish/runPolish.js.map +1 -0
  302. package/dist/post-steps/polish/runPolishCall.d.ts +22 -0
  303. package/dist/post-steps/polish/runPolishCall.d.ts.map +1 -0
  304. package/dist/post-steps/polish/runPolishCall.js +32 -0
  305. package/dist/post-steps/polish/runPolishCall.js.map +1 -0
  306. package/dist/post-steps/resolvePostStepConfig.d.ts +58 -0
  307. package/dist/post-steps/resolvePostStepConfig.d.ts.map +1 -0
  308. package/dist/post-steps/resolvePostStepConfig.js +105 -0
  309. package/dist/post-steps/resolvePostStepConfig.js.map +1 -0
  310. package/dist/rendrixUpstreamExports.d.ts +7 -0
  311. package/dist/rendrixUpstreamExports.d.ts.map +1 -0
  312. package/dist/rendrixUpstreamExports.js +6 -0
  313. package/dist/rendrixUpstreamExports.js.map +1 -0
  314. package/dist/skillCatalogExports.d.ts +8 -0
  315. package/dist/skillCatalogExports.d.ts.map +1 -0
  316. package/dist/skillCatalogExports.js +8 -0
  317. package/dist/skillCatalogExports.js.map +1 -0
  318. package/dist/strategies/direct-execution-strategy.d.ts +31 -0
  319. package/dist/strategies/direct-execution-strategy.d.ts.map +1 -0
  320. package/dist/strategies/direct-execution-strategy.js +107 -0
  321. package/dist/strategies/direct-execution-strategy.js.map +1 -0
  322. package/dist/strategies/execution-strategy.interface.d.ts +31 -0
  323. package/dist/strategies/execution-strategy.interface.d.ts.map +1 -0
  324. package/dist/strategies/execution-strategy.interface.js +2 -0
  325. package/dist/strategies/execution-strategy.interface.js.map +1 -0
  326. package/dist/strategies/index.d.ts +9 -0
  327. package/dist/strategies/index.d.ts.map +1 -0
  328. package/dist/strategies/index.js +8 -0
  329. package/dist/strategies/index.js.map +1 -0
  330. package/dist/strategies/strategy-factory.d.ts +45 -0
  331. package/dist/strategies/strategy-factory.d.ts.map +1 -0
  332. package/dist/strategies/strategy-factory.js +59 -0
  333. package/dist/strategies/strategy-factory.js.map +1 -0
  334. package/dist/synthesis/index.d.ts +9 -0
  335. package/dist/synthesis/index.d.ts.map +1 -0
  336. package/dist/synthesis/index.js +8 -0
  337. package/dist/synthesis/index.js.map +1 -0
  338. package/dist/synthesis/resolveSourceMaterial.d.ts +35 -0
  339. package/dist/synthesis/resolveSourceMaterial.d.ts.map +1 -0
  340. package/dist/synthesis/resolveSourceMaterial.js +152 -0
  341. package/dist/synthesis/resolveSourceMaterial.js.map +1 -0
  342. package/dist/synthesis/runStructuredSynthesisRobust.d.ts +42 -0
  343. package/dist/synthesis/runStructuredSynthesisRobust.d.ts.map +1 -0
  344. package/dist/synthesis/runStructuredSynthesisRobust.js +303 -0
  345. package/dist/synthesis/runStructuredSynthesisRobust.js.map +1 -0
  346. package/dist/task-strategies/buildTaskStrategyCatalogDescriptor.d.ts +19 -0
  347. package/dist/task-strategies/buildTaskStrategyCatalogDescriptor.d.ts.map +1 -0
  348. package/dist/task-strategies/buildTaskStrategyCatalogDescriptor.js +242 -0
  349. package/dist/task-strategies/buildTaskStrategyCatalogDescriptor.js.map +1 -0
  350. package/dist/task-strategies/canonicalInputExecutionStrategies.d.ts +171 -0
  351. package/dist/task-strategies/canonicalInputExecutionStrategies.d.ts.map +1 -0
  352. package/dist/task-strategies/canonicalInputExecutionStrategies.js +117 -0
  353. package/dist/task-strategies/canonicalInputExecutionStrategies.js.map +1 -0
  354. package/dist/task-strategies/canonicalNarrixModes.d.ts +31 -0
  355. package/dist/task-strategies/canonicalNarrixModes.d.ts.map +1 -0
  356. package/dist/task-strategies/canonicalNarrixModes.js +35 -0
  357. package/dist/task-strategies/canonicalNarrixModes.js.map +1 -0
  358. package/dist/task-strategies/canonicalTaskStrategies.d.ts +104 -0
  359. package/dist/task-strategies/canonicalTaskStrategies.d.ts.map +1 -0
  360. package/dist/task-strategies/canonicalTaskStrategies.js +77 -0
  361. package/dist/task-strategies/canonicalTaskStrategies.js.map +1 -0
  362. package/dist/task-strategies/cataloxCatalogViews.d.ts +55 -0
  363. package/dist/task-strategies/cataloxCatalogViews.d.ts.map +1 -0
  364. package/dist/task-strategies/cataloxCatalogViews.js +65 -0
  365. package/dist/task-strategies/cataloxCatalogViews.js.map +1 -0
  366. package/dist/task-strategies/constants.d.ts +49 -0
  367. package/dist/task-strategies/constants.d.ts.map +1 -0
  368. package/dist/task-strategies/constants.js +49 -0
  369. package/dist/task-strategies/constants.js.map +1 -0
  370. package/dist/task-strategies/index.d.ts +22 -0
  371. package/dist/task-strategies/index.d.ts.map +1 -0
  372. package/dist/task-strategies/index.js +13 -0
  373. package/dist/task-strategies/index.js.map +1 -0
  374. package/dist/task-strategies/listAiTaskStrategies.d.ts +43 -0
  375. package/dist/task-strategies/listAiTaskStrategies.d.ts.map +1 -0
  376. package/dist/task-strategies/listAiTaskStrategies.js +74 -0
  377. package/dist/task-strategies/listAiTaskStrategies.js.map +1 -0
  378. package/dist/task-strategies/normalize.d.ts +7 -0
  379. package/dist/task-strategies/normalize.d.ts.map +1 -0
  380. package/dist/task-strategies/normalize.js +44 -0
  381. package/dist/task-strategies/normalize.js.map +1 -0
  382. package/dist/task-strategies/types.d.ts +37 -0
  383. package/dist/task-strategies/types.d.ts.map +1 -0
  384. package/dist/task-strategies/types.js +2 -0
  385. package/dist/task-strategies/types.js.map +1 -0
  386. package/dist/types/decision-contracts.d.ts +31 -0
  387. package/dist/types/decision-contracts.d.ts.map +1 -0
  388. package/dist/types/decision-contracts.js +23 -0
  389. package/dist/types/decision-contracts.js.map +1 -0
  390. package/dist/types/evidence-types.d.ts +108 -0
  391. package/dist/types/evidence-types.d.ts.map +1 -0
  392. package/dist/types/evidence-types.js +9 -0
  393. package/dist/types/evidence-types.js.map +1 -0
  394. package/dist/types/executionType.d.ts +9 -0
  395. package/dist/types/executionType.d.ts.map +1 -0
  396. package/dist/types/executionType.js +8 -0
  397. package/dist/types/executionType.js.map +1 -0
  398. package/dist/types/index.d.ts +28 -0
  399. package/dist/types/index.d.ts.map +1 -0
  400. package/dist/types/index.js +12 -0
  401. package/dist/types/index.js.map +1 -0
  402. package/dist/types/llmCall.d.ts +121 -0
  403. package/dist/types/llmCall.d.ts.map +1 -0
  404. package/dist/types/llmCall.js +39 -0
  405. package/dist/types/llmCall.js.map +1 -0
  406. package/dist/types/task-configuration.d.ts +60 -0
  407. package/dist/types/task-configuration.d.ts.map +1 -0
  408. package/dist/types/task-configuration.js +3 -0
  409. package/dist/types/task-configuration.js.map +1 -0
  410. package/dist/types/task-types.d.ts +887 -0
  411. package/dist/types/task-types.d.ts.map +1 -0
  412. package/dist/types/task-types.js +21 -0
  413. package/dist/types/task-types.js.map +1 -0
  414. package/dist/utilities/runUtility.d.ts +3 -0
  415. package/dist/utilities/runUtility.d.ts.map +1 -0
  416. package/dist/utilities/runUtility.js +204 -0
  417. package/dist/utilities/runUtility.js.map +1 -0
  418. package/dist/utils/assertRequiredRunSkillCorrelation.d.ts +7 -0
  419. package/dist/utils/assertRequiredRunSkillCorrelation.d.ts.map +1 -0
  420. package/dist/utils/assertRequiredRunSkillCorrelation.js +17 -0
  421. package/dist/utils/assertRequiredRunSkillCorrelation.js.map +1 -0
  422. package/dist/utils/assertValidSmartInputConfig.d.ts +5 -0
  423. package/dist/utils/assertValidSmartInputConfig.d.ts.map +1 -0
  424. package/dist/utils/assertValidSmartInputConfig.js +71 -0
  425. package/dist/utils/assertValidSmartInputConfig.js.map +1 -0
  426. package/dist/utils/bridgeRunSkillGatewayMemory.d.ts +13 -0
  427. package/dist/utils/bridgeRunSkillGatewayMemory.d.ts.map +1 -0
  428. package/dist/utils/bridgeRunSkillGatewayMemory.js +65 -0
  429. package/dist/utils/bridgeRunSkillGatewayMemory.js.map +1 -0
  430. package/dist/utils/extractSmartInputRenderResult.d.ts +7 -0
  431. package/dist/utils/extractSmartInputRenderResult.d.ts.map +1 -0
  432. package/dist/utils/extractSmartInputRenderResult.js +30 -0
  433. package/dist/utils/extractSmartInputRenderResult.js.map +1 -0
  434. package/dist/utils/jsonPaths.d.ts +6 -0
  435. package/dist/utils/jsonPaths.d.ts.map +1 -0
  436. package/dist/utils/jsonPaths.js +32 -0
  437. package/dist/utils/jsonPaths.js.map +1 -0
  438. package/dist/utils/normalizeSmartInputConfig.d.ts +5 -0
  439. package/dist/utils/normalizeSmartInputConfig.d.ts.map +1 -0
  440. package/dist/utils/normalizeSmartInputConfig.js +30 -0
  441. package/dist/utils/normalizeSmartInputConfig.js.map +1 -0
  442. package/dist/utils/outputValidation.d.ts +19 -0
  443. package/dist/utils/outputValidation.d.ts.map +1 -0
  444. package/dist/utils/outputValidation.js +75 -0
  445. package/dist/utils/outputValidation.js.map +1 -0
  446. package/dist/utils/runTaskRequestShape.d.ts +16 -0
  447. package/dist/utils/runTaskRequestShape.d.ts.map +1 -0
  448. package/dist/utils/runTaskRequestShape.js +80 -0
  449. package/dist/utils/runTaskRequestShape.js.map +1 -0
  450. package/dist/utils/skillTemplateVariables.d.ts +20 -0
  451. package/dist/utils/skillTemplateVariables.d.ts.map +1 -0
  452. package/dist/utils/skillTemplateVariables.js +63 -0
  453. package/dist/utils/skillTemplateVariables.js.map +1 -0
  454. package/dist/utils/xynthesizedSmartInputPaths.d.ts +16 -0
  455. package/dist/utils/xynthesizedSmartInputPaths.d.ts.map +1 -0
  456. package/dist/utils/xynthesizedSmartInputPaths.js +56 -0
  457. package/dist/utils/xynthesizedSmartInputPaths.js.map +1 -0
  458. package/dist/utils/xynthesizedWrite.d.ts +10 -0
  459. package/dist/utils/xynthesizedWrite.d.ts.map +1 -0
  460. package/dist/utils/xynthesizedWrite.js +61 -0
  461. package/dist/utils/xynthesizedWrite.js.map +1 -0
  462. package/dist/validation/analyzeExpectedRunTaskInput.d.ts +41 -0
  463. package/dist/validation/analyzeExpectedRunTaskInput.d.ts.map +1 -0
  464. package/dist/validation/analyzeExpectedRunTaskInput.js +133 -0
  465. package/dist/validation/analyzeExpectedRunTaskInput.js.map +1 -0
  466. package/dist/validation/collectSmartInputValidationIssues.d.ts +6 -0
  467. package/dist/validation/collectSmartInputValidationIssues.d.ts.map +1 -0
  468. package/dist/validation/collectSmartInputValidationIssues.js +38 -0
  469. package/dist/validation/collectSmartInputValidationIssues.js.map +1 -0
  470. package/dist/validation/helpers.d.ts +15 -0
  471. package/dist/validation/helpers.d.ts.map +1 -0
  472. package/dist/validation/helpers.js +184 -0
  473. package/dist/validation/helpers.js.map +1 -0
  474. package/dist/validation/index.d.ts +9 -0
  475. package/dist/validation/index.d.ts.map +1 -0
  476. package/dist/validation/index.js +6 -0
  477. package/dist/validation/index.js.map +1 -0
  478. package/dist/validation/types.d.ts +51 -0
  479. package/dist/validation/types.d.ts.map +1 -0
  480. package/dist/validation/types.js +5 -0
  481. package/dist/validation/types.js.map +1 -0
  482. package/dist/validation/validateRunTaskConfig.d.ts +8 -0
  483. package/dist/validation/validateRunTaskConfig.d.ts.map +1 -0
  484. package/dist/validation/validateRunTaskConfig.js +158 -0
  485. package/dist/validation/validateRunTaskConfig.js.map +1 -0
  486. package/dist/validation/validateRunTaskInvoke.d.ts +30 -0
  487. package/dist/validation/validateRunTaskInvoke.d.ts.map +1 -0
  488. package/dist/validation/validateRunTaskInvoke.js +108 -0
  489. package/dist/validation/validateRunTaskInvoke.js.map +1 -0
  490. package/documenations/activix-feature-request-identity.md +123 -0
  491. package/documenations/activix.md +175 -0
  492. package/documenations/bug-report-xynthesis-and-synthesis-call.md +217 -0
  493. package/documenations/core-runtime-tokens-and-strategies.md +123 -0
  494. package/documenations/downstream-environment.md +48 -0
  495. package/documenations/downstream-test-runtime-teardown-cleanup.md +73 -0
  496. package/documenations/examples/xynthesis-run-task-request.example.json +170 -0
  497. package/documenations/feature-request-ai-skills-raw-template-access.md +82 -0
  498. package/documenations/feature-request-athenix-core-directive.md +145 -0
  499. package/documenations/feature-request-athenix-token-extraction.md +124 -0
  500. package/documenations/funcx-catalog-hosting-checklist.md +107 -0
  501. package/documenations/funcx-scoping-integration-gaps.md +120 -0
  502. package/documenations/funcx-upstream-github-issues-draft.md +153 -0
  503. package/documenations/identity-metadata-contract.md +165 -0
  504. package/documenations/intermediate-steps.md +33 -0
  505. package/documenations/record-and-template-variables.md +32 -0
  506. package/documenations/run-task-execution-flow.md +153 -0
  507. package/documenations/run-task-single-run-checklist.md +109 -0
  508. package/documenations/schemas/README.md +40 -0
  509. package/documenations/schemas/openapi-3.1-components.yaml +24 -0
  510. package/documenations/schemas/v1/output-schema.json +55 -0
  511. package/documenations/schemas/v1/output-validation-result.json +41 -0
  512. package/documenations/schemas/v1/run-task-request.json +219 -0
  513. package/documenations/schemas/v1/synthesized-artifacts.json +133 -0
  514. package/documenations/synthesis-invocation-notes.md +26 -0
  515. package/documenations/synthesized-context-guide.md +84 -0
  516. package/documenations/task-core-and-core-aware-synthesis.md +58 -0
  517. package/documenations/upstream-feature-requests/ai-skills-llm-observability.md +129 -0
  518. package/documenations/upstream-feature-requests/xynthesis-llm-observability.md +125 -0
  519. package/documenations/upstream-feedback-request-shape-clarification.md +101 -0
  520. package/documenations/web-context-precedence.md +33 -0
  521. package/documenations/web-scoping-in-ai-tasks.md +503 -0
  522. package/documenations/xynthesis-activix-telemetry.md +28 -0
  523. package/documenations/xynthesis-upstream-fixes-checklist.md +71 -0
  524. package/package.json +92 -0
@@ -0,0 +1,153 @@
1
+ # FuncX upstream — draft GitHub issues
2
+
3
+ Use these as copy-paste bodies when filing against **`https://github.com/x12i/funcx`** (adjust labels: `bug`, `documentation`, `enhancement` as appropriate).
4
+
5
+ **Update (@x12i/funcx ≥ 3.8.2):** Issue **#1** is largely addressed in-package via **`getRunJsonResult`**, **`isHttpRunSuccessBody`**, **`GenericExecutionEnvelope`**, **`genericExecutionEnvelopeJsonSchema`**, and **`buildAskAttribution`** exported from `@x12i/funcx/functions`. **`@exellix/ai-tasks`** depends on **`^3.8.2`** and delegates **`unwrapFuncxRunValue`** to **`getRunJsonResult`** (normalization fixes: **3.8.2**).
6
+
7
+ ---
8
+
9
+ ## Issue 1 — `run()` success value shape is not formally specified or normalized (Bug / API contract)
10
+
11
+ **Status:** Superseded for normalization — use **`getRunJsonResult`** (**≥3.8.2** recommended). Remaining gap: ensure **README / migration** links every consumer to this API (Issue #5 overlap).
12
+
13
+ **Title:** `run()`: document and export stable JSON extraction for function results
14
+
15
+ **Type:** Bug (integration hazard) + Documentation
16
+
17
+ ### Summary
18
+
19
+ Downstream packages (e.g. `@exellix/ai-tasks`) call `run(functionId, payload, { client })` from `@x12i/funcx/functions` and must pass the **parsed function JSON** into app-specific adapters. The **success return shape** of `run()` is not clearly guaranteed in public TypeScript types or docs: hosts may wrap the model/object as `output`, `data`, `result`, or return the object root directly.
20
+
21
+ ### Current behavior
22
+
23
+ Integrators defensively unwrap multiple keys or treat the whole value as JSON, which is fragile and can silently feed adapters the wrong object.
24
+
25
+ ### Expected behavior
26
+
27
+ 1. **Document** the canonical success shape of `run()` for JSON-returning functions (one paragraph + example in package README or `run` JSDoc).
28
+ 2. **Export** a small helper, e.g. `getRunJsonResult(runResult: unknown): unknown` (name TBD), that implements the **supported** unwrapping rules so consumers do not duplicate heuristics.
29
+ 3. **Type** the resolved JSON result where possible (generic parameter or discriminated union), even if implementation stays dynamic internally.
30
+
31
+ ### Acceptance criteria
32
+
33
+ - [ ] Public API + docs agree on one normalization path.
34
+ - [ ] At least one unit test in `@x12i/funcx` locks the behavior for JSON-mode functions.
35
+ - [ ] Changelog calls out any tightening if older hosts relied on ambiguous shapes.
36
+
37
+ ### References
38
+
39
+ - Consumer workaround today: local `unwrapFuncxRunValue` heuristics in `@exellix/ai-tasks` (`genericExecutionFuncxEnvelope.ts`).
40
+
41
+ ---
42
+
43
+ ## Issue 2 — No published TypeScript / JSON Schema for generic execution envelope (Feature)
44
+
45
+ **Title:** Publish shared types (and optional JSON Schema) for generic `goal` / `input` / `context` / `result` / `args` / `attribution` contracts
46
+
47
+ **Type:** Feature request
48
+
49
+ ### Summary
50
+
51
+ Multiple products want the same **generic FuncX envelope** for capabilities such as `execution/plan`, `execution/evaluate-result`, and `research/plan-questions`. Today each consumer re-declares structural types, which risks drift from FuncX’s actual validation and from other clients.
52
+
53
+ ### Request
54
+
55
+ 1. Export TypeScript types from `@x12i/funcx` (or a sibling package) for:
56
+ - Generic request envelope (`goal`, `input?`, `context?`, `result?`, `args?`, `attribution?`).
57
+ - Optional: per-function **response** types or Zod schemas where FuncX validates outputs.
58
+ 2. Optionally publish **JSON Schema** artifacts for the same contracts (for non-TS hosts and catalog tooling).
59
+
60
+ ### Acceptance criteria
61
+
62
+ - [ ] Types are importable from a documented entrypoint (e.g. `@x12i/funcx` or `@x12i/funcx/contracts`).
63
+ - [ ] Version SemVer policy documented (breaking changes to envelope bump major or explicit migration note).
64
+
65
+ ### References
66
+
67
+ - Draft consumer types: `@exellix/ai-tasks` `genericExecutionFuncxEnvelope.ts`.
68
+
69
+ ---
70
+
71
+ ## Issue 3 — Canonical catalog functions for generic execution / research planning (Feature)
72
+
73
+ **Title:** Ship and register `execution/plan`, `execution/evaluate-result`, `research/plan-questions` as first-class FuncX functions
74
+
75
+ **Type:** Feature request (blocking for generic orchestration clients)
76
+
77
+ ### Summary
78
+
79
+ Orchestrators are standardizing on **capability-based** ids (`execution/plan`, etc.) with a **single generic envelope**. Consumers call `run()` with that payload. Today, npm still emphasizes legacy **`aiTasksPlanTask` / `aiTasksOptimizerEvaluate`**-style entrypoints while the ecosystem moves away from product-prefixed ids and bespoke envelopes.
80
+
81
+ ### Request
82
+
83
+ 1. Implement the three functions with behavior matching the published generic contract (prompting, JSON mode, validation, retries as appropriate).
84
+ 2. Register them in the **content/catalog path** used by `run()` for typical deployments (document exact ids: slash + hyphen router forms).
85
+ 3. Forward **`attribution`** from the inbound envelope into **every** nested `client.ask()` / `askJson` call inside those functions (for billing/trace parity).
86
+ 4. Document migration for hosts that still register **`ai-tasks/plan-task`** (if aliases are supported, document explicitly; if not, document cutover).
87
+
88
+ ### Acceptance criteria
89
+
90
+ - [ ] `run("execution/plan", payload, { client })` (and hyphen alias if applicable) returns validated JSON per spec.
91
+ - [ ] Same for `execution/evaluate-result` and `research/plan-questions`.
92
+ - [ ] Live or CI-backed test that attribution tags survive to provider-facing calls where OpenRouter/Activix expect them.
93
+
94
+ ### References
95
+
96
+ - Consumer defaults: `@exellix/ai-tasks` `constants.ts` (`FUNCX_EXECUTION_*`, `FUNCX_RESEARCH_PLAN_QUESTIONS_FUNCTION_ID`).
97
+
98
+ ---
99
+
100
+ ## Issue 4 — Document attribution forwarding contract for custom FuncX functions (Documentation)
101
+
102
+ **Title:** Document: function implementations MUST propagate `payload.attribution` (or equivalent) to nested LLM calls
103
+
104
+ **Type:** Documentation (severity: high for observability)
105
+
106
+ ### Summary
107
+
108
+ Generic envelopes include **`attribution`** (`runId`, `subjectId`, `actorId`, `tags`, etc.). If implementers only log the outer HTTP boundary but omit attribution on internal `ask()` calls, **usage, cost, and trace correlation** break for nested completions.
109
+
110
+ ### Request
111
+
112
+ 1. Add a **short “FuncX function author checklist”** section: read `attribution` from input → merge with `functionId` / `traceId` as needed → pass on `AskOptions.attribution` for every LLM call.
113
+ 2. Reference existing helpers (`formatOpenRouterUserField`, `execAttribution`, etc.) if those are the supported path.
114
+ 3. Optionally add a **lint or runtime warning** in dev mode when `ask()` is invoked without attribution inside functions that received a populated envelope (stretch goal).
115
+
116
+ ### Acceptance criteria
117
+
118
+ - [ ] Public docs linked from `run()` / “authoring functions” guide.
119
+ - [ ] Example function in repo demonstrates nested attribution.
120
+
121
+ ---
122
+
123
+ ## Issue 5 — Clarify relationship between direct TS exports (`aiTasksPlanTask`) and `run()` generic functions (Documentation / Deprecation)
124
+
125
+ **Title:** Migration guide: `aiTasksPlanTask` / `aiTasksOptimizerEvaluate` vs `run("execution/plan", …)` generic envelope
126
+
127
+ **Type:** Documentation + Deprecation policy (could start as docs-only)
128
+
129
+ ### Summary
130
+
131
+ `@x12i/funcx/functions` still exports **direct** helpers for legacy ai-tasks-shaped payloads while new integrators use **`run()`** + generic envelope + new ids. Without an explicit migration table, teams duplicate behavior or pick the wrong integration path.
132
+
133
+ ### Request
134
+
135
+ 1. Document **one recommended path** for new code (generic ids + `run()` + shared types).
136
+ 2. State whether **`aiTasksPlanTask`** / **`aiTasksOptimizerEvaluate`** are **deprecated**, **supported aliases**, or **frozen** — with semver expectations.
137
+ 3. If generic functions supersede them, provide a **payload mapping table** (old `kind` + `request` → new `goal` + `input` + `context` + `attribution`).
138
+
139
+ ### Acceptance criteria
140
+
141
+ - [ ] README or `docs/migration-generic-execution.md` committed and linked from changelog when generic functions ship.
142
+
143
+ ---
144
+
145
+ ### Filing checklist
146
+
147
+ | Draft # | Suggested GitHub label | Blocking `@exellix/ai-tasks`? |
148
+ |---------|-------------------------------|-----------------------------------|
149
+ | 1 | `bug`, `documentation`, `api` | Yes (correctness of parsing) |
150
+ | 2 | `enhancement` | No (quality / drift reduction) |
151
+ | 3 | `enhancement` | Yes (runtime unless content-only) |
152
+ | 4 | `documentation` | Yes (observability parity) |
153
+ | 5 | `documentation` | No (clarity / migration) |
@@ -0,0 +1,165 @@
1
+ # Feature request: `identity` propagation + Activix identity
2
+
3
+ ## Goal
4
+
5
+ Add a generic, end-to-end **identity envelope** to each task run so that:
6
+
7
+ - Upstream callers can describe *what this task instance is* (domain identity, purpose, correlation).
8
+ - Runtime can add a **unique per-run `taskId`** and the **`skillId` used**.
9
+ - Downstream components that support Activix receive this identity as a **first-class Activix field**: `identity`.
10
+
11
+ This is a contract-level feature request for **`ai-gateway`** and **`ai-skills`** integrations, expressed generically so it applies to any task/skill combination.
12
+
13
+ ---
14
+
15
+ ## Terminology
16
+
17
+ - **Upstream**: The caller that initiates a `runTask` request (product/app/service).
18
+ - **Gateway**: The LLM gateway layer (`ai-gateway`) used for model/tool calls.
19
+ - **Skills**: Skill resolver/executor layer (`ai-skills`) used by task execution.
20
+ - **Downstream**: Any component invoked during execution (LLM calls, tools, connectors). This doc focuses on **Activix-capable** downstreams.
21
+ - **Activix-capable**: A downstream path that records execution via Activix and can attach first-class `identity`.
22
+
23
+ ---
24
+
25
+ ## API shape (high-level)
26
+
27
+ ### Upstream request addition
28
+
29
+ Task-run requests should allow an optional field:
30
+
31
+ - `identity?: object`
32
+
33
+ Constraints:
34
+
35
+ - Treat as an **opaque JSON object** (no strict schema required at first).
36
+ - Must be safe for logging/tracing (no secrets). If secrets are possible, either upstream must redact or the runtime must enforce redaction policy before emitting observability.
37
+
38
+ ### Runtime enrichment (per execution instance)
39
+
40
+ For every execution instance, runtime must produce an **effective identity**:
41
+
42
+ - `effectiveIdentity = identity (from upstream, if present) + { taskId, skillId }`
43
+
44
+ Where:
45
+
46
+ - `taskId`: **required**, generated by runtime, unique per task-run instance.
47
+ - `skillId`: **required when a skill is selected/resolved**, set to the skill used for this run.
48
+
49
+ Notes:
50
+
51
+ - `identity` from upstream is **never dropped** when present.
52
+ - `taskId` and `skillId` **must not** be accepted from upstream as authoritative values if they are provided there; runtime-generated/selected values win.
53
+
54
+ ---
55
+
56
+ ## Behavior contract
57
+
58
+ ### 1) Preserve upstream identity
59
+
60
+ - If upstream sends `identity`, keep it attached to the run for the full lifecycle.
61
+ - If upstream does not send it, initialize identity as an empty object for the purpose of downstream propagation and enrichment.
62
+
63
+ ### 2) Create a per-run `taskId`
64
+
65
+ - Create `taskId` once per `runTask` invocation.
66
+ - The ID must be stable across the entire run (pre/main/post steps, retries within the run, and all downstream calls spawned by this run).
67
+ - The ID must be unique across runs (collision-resistant).
68
+
69
+ ### 3) Attach `skillId` when known
70
+
71
+ - When the runtime resolves the skill used for this run, attach `skillId` to the effective identity.
72
+ - If the run is “direct” (no skills), either:
73
+ - omit `skillId`, or
74
+ - set `skillId` to a documented sentinel (only if that’s already a platform convention).
75
+
76
+ ### 4) Forward to all Activix-capable downstream calls
77
+
78
+ When creating Activix records, attach identity as a first-class field:
79
+
80
+ - `activixRecord.identity = effectiveIdentity`
81
+
82
+ This requires Activix to treat `identity` as a first-class, supported object field (preserved end-to-end on start/complete/fail and queryable in stored records). This is intentional: identity is part of the methodology/contract, not an ad-hoc blob nested under arbitrary meta.
83
+
84
+ This identity must be included for:
85
+
86
+ - MAIN execution calls
87
+ - PRE steps that call downstream (e.g., synthesis)
88
+ - POST steps that call downstream
89
+
90
+ If a downstream path is not Activix-capable, the runtime should still retain the identity in memory/metadata so it can be used when a later step *is* Activix-capable.
91
+
92
+ ---
93
+
94
+ ## Ownership and responsibilities
95
+
96
+ ### Upstream (product/service calling `runTask`)
97
+
98
+ - Provide `identity` describing the task instance in domain terms.
99
+ - Do not include secrets.
100
+ - Do not attempt to control `taskId` generation; treat `taskId` as runtime-owned.
101
+
102
+ Examples of useful upstream fields (non-prescriptive):
103
+
104
+ - `source`: service/app identifier
105
+ - `purpose`: why the task was launched
106
+ - `correlationId`: upstream correlation ID (if already present)
107
+ - `user`: stable user/account identity (non-secret)
108
+ - `entity`: domain object reference (e.g., `{ type: "...", id: "..." }`)
109
+
110
+ ### ai-skills (skill resolution/execution)
111
+
112
+ - Ensure `skillId` for the selected skill is available to the runtime and included in the effective identity.
113
+ - Ensure any skill-spawned downstream calls that record to Activix also receive the effective identity in Activix record `identity`.
114
+
115
+ ### ai-gateway (gateway for LLM/tool calls)
116
+
117
+ - Accept and preserve an identity object on calls originating from task execution.
118
+ - When the gateway records to Activix, place the effective identity under top-level `identity` (do not rename/flatten fields).
119
+ - Do not mutate upstream identity fields except for the controlled addition/override of `taskId` and `skillId` as defined in this contract.
120
+
121
+ ---
122
+
123
+ ## Activix mapping (required)
124
+
125
+ When an execution path uses Activix:
126
+
127
+ - **Input**: Upstream `identity` + runtime `{ taskId, skillId }`
128
+ - **Output**: `identity` equals the merged object
129
+
130
+ Merging rules:
131
+
132
+ - Start with upstream `identity` (or `{}` if missing)
133
+ - Add/overwrite:
134
+ - `taskId` (runtime generated)
135
+ - `skillId` (runtime resolved)
136
+
137
+ ---
138
+
139
+ ## Observability and debugging (recommended)
140
+
141
+ Expose minimal, non-sensitive observability so runs can be traced:
142
+
143
+ - `metadata.taskId` (top-level convenience mirror)
144
+ - `metadata.skillId` (top-level convenience mirror when present)
145
+ - `metadata.identityPresent: boolean`
146
+
147
+ If the full `identity` is logged, enforce redaction policy; otherwise log only safe subsets or presence flags.
148
+
149
+ ---
150
+
151
+ ## Backward compatibility stance
152
+
153
+ - New field is additive: existing callers continue to work with `identity` absent.
154
+ - Downstream Activix paths should be tolerant to missing identity fields (but runtime should always generate `taskId` once this feature is implemented).
155
+
156
+ ---
157
+
158
+ ## Acceptance criteria
159
+
160
+ - A `runTask` request may include `identity` and it is preserved for the full run.
161
+ - Each run results in a unique runtime-generated `taskId` that is stable across all downstream calls for that run.
162
+ - When a skill is used, the effective identity includes `skillId`.
163
+ - Any Activix record created by the system includes first-class `identity` populated with the effective identity.
164
+ - Minimal observability surfaces `taskId` (and `skillId` when applicable) so traces/logs can correlate all calls to a single run.
165
+
@@ -0,0 +1,33 @@
1
+ # Intermediate Steps
2
+
3
+ This appendix explains how `intermediateSteps` are exposed in `@exellix/ai-tasks` responses.
4
+
5
+ ## Purpose
6
+
7
+ `intermediateSteps` provides a normalized, ordered trace of multi-step execution inside a single `runTask()` call.
8
+
9
+ ## Response shape
10
+
11
+ Each step includes:
12
+
13
+ - `step` (number, 1-based order)
14
+ - `id` (stable identifier, for example: `narrix`, `synthesis`, `audit-cycle-1`)
15
+ - `ok` (boolean)
16
+ - Optional fields: `summary`, `error`, `inputSummary`, `outputExcerpt`
17
+
18
+ ## Where steps come from
19
+
20
+ - Local task handlers that return `intermediateSteps`
21
+ - `narrix-then-direct` path (prepends a `narrix` step)
22
+ - `executionPipeline` PRE/POST behavior (for example `synthesis`, `audit`, `polish`)
23
+
24
+ ## Runtime behavior
25
+
26
+ - Runtime may lift `parsed.intermediateSteps` to top-level `response.intermediateSteps`.
27
+ - Step numbering is normalized and continuous after runtime-inserted steps.
28
+ - Consumers should read steps from top-level `response.intermediateSteps`.
29
+
30
+ ## Related appendices
31
+
32
+ - `documenations/run-task-execution-flow.md`
33
+ - `documenations/core-runtime-tokens-and-strategies.md`
@@ -0,0 +1,32 @@
1
+ # Record fields and template variables (`runTask`)
2
+
3
+ This document describes how **task input** and **record-shaped** payloads reach gateway templates and skills, and how that relates to NARRIX pre-processing.
4
+
5
+ ## Default: forward opaque fields (no allowlist)
6
+
7
+ For the **MAIN** LLM path, `mergeSkillTemplateVariables` builds the `variables` object sent to the executor / gateway:
8
+
9
+ - **`jobContext`** is merged first (lowest precedence).
10
+ - Explicit **`variables`** are merged on top.
11
+ - When **`input`** is a plain object, **every enumerable key** on `input` is copied into **`variables.inputs`** (merged with any existing `variables.inputs`). If `input.question` is a string and `variables.question` is unset, it is also copied to **`variables.question`**.
12
+
13
+ There is **no** stripping of unknown or “enrichment” keys such as **`mitreAttack`**, nested blobs, or vendor-specific fields, as long as they live on the **`input`** object (or on nested objects under `input`, e.g. `input.record.mitreAttack`).
14
+
15
+ **Implication:** templates that reference `inputs.record.mitreAttack`, `inputs.mitreAttack`, etc. receive the same JSON shape the caller passed on `RunTaskRequest.input`, unless a **future** explicit blocklist is added (none by default).
16
+
17
+ ## Reserved / runtime-owned names (conventions)
18
+
19
+ These are **not** automatically stripped today, but **callers should avoid** using them on `input` for domain data if they conflict with runtime-injected fields:
20
+
21
+ - **`aiScoped`** — may be injected by the AI scoping pre-step when `aiScoping` is configured.
22
+ - **`question`** — special-cased for template convenience (`variables.question`).
23
+
24
+ Memory surfaces (**`jobMemory`**, **`taskMemory`**, **`executionMemory`**) use their own keys (`_narrix`, `webContext`, `synthesizedContext`, `synthesizedInput`, `webContextMarkdown`, etc.). Domain records are usually under **`input`**, **`jobMemory.record`**, **`jobMemory.currentRecord`**, or **`executionMemory.input.raw`** / **`executionMemory.input.record`** depending on orchestration; see NARRIX adapter tests and [run-task-execution-flow.md](./run-task-execution-flow.md).
25
+
26
+ ## NARRIX `record` medium
27
+
28
+ For **`medium: "record"`**, the object passed to Narrix is produced by **`@woroces/memory-narrix-adapter`** from configured memory paths. That adapter returns the **resolved record object**; enrichment fields on that object are preserved **unless** a future blocklist is introduced in the adapter or caller.
29
+
30
+ ## Regression expectation
31
+
32
+ A record that includes **`mitreAttack`** on the task **`input`** (e.g. under **`input.record`**) is reflected unchanged under **`variables.inputs`** for the MAIN skill invocation.
@@ -0,0 +1,153 @@
1
+ # Current Behavior Flow (`runTask`)
2
+
3
+ This document describes the **current** end-to-end behavior of `@exellix/ai-tasks` when `runTask()` is called.
4
+
5
+ ## Flow Diagram
6
+
7
+ ```mermaid
8
+ flowchart TD
9
+ A[Start: runTask] --> R0[resolveRunTaskRuntimeKnobs]
10
+ R0 --> B{narrixMode preprocessor + request.narrix?}
11
+ B -- No --> B2{narrixMode handler?}
12
+
13
+ B -- Yes --> N1[Resolve raw record]
14
+ N1 --> N2[Run Narrix pre-processor]
15
+ N2 --> N3[Attach _narrix to executionMemory and jobMemory]
16
+ N3 --> N4{narrix.enableWebScope === true?}
17
+ N4 -- Yes --> N5[Run web scoper]
18
+ N5 --> N6[Set executionMemory.webContext]
19
+ N4 -- No --> B2
20
+ N6 --> B2
21
+
22
+ B2 -- Yes --> H1[Resolve narrixInput]
23
+ H1 --> H2[Run structured Narrix handler]
24
+ H2 --> H3{ok?}
25
+ H3 -- No --> H4[Return early phase narrix]
26
+ H3 -- Yes --> H5[Merge taskMemory.narrix + input.narrixContext; force MAIN direct]
27
+ H5 --> C
28
+ B2 -- No --> C{Local task registered?}
29
+
30
+ C -- Yes --> L1[Local handler]
31
+ L1 --> L2[Return]
32
+ C -- No --> F[Inject bindingDefaultsDb + enrich memories]
33
+
34
+ F --> G{includeContextInPrompt === true?}
35
+ G -- No --> I[Context empty]
36
+ G -- Yes --> J[Build context markdown]
37
+ I --> P
38
+ J --> P{executionPipeline?}
39
+
40
+ P -- Yes --> P1[PRE: synthesized-context only]
41
+ P1 --> P2[MAIN]
42
+ P2 --> P3[POST optional]
43
+ P3 --> K[Gateway execute]
44
+ P -- No --> K
45
+
46
+ K --> M{Missing skill?}
47
+ M --> R[Response]
48
+ H4 --> R
49
+ L2 --> R
50
+ ```
51
+
52
+ ## Step-by-Step Behavior
53
+
54
+ 1. Receive `runTask` request with `skillKey`, `input`, memory fields, and optional execution settings.
55
+ 2. Resolve **`narrixMode`**, **`inputStrategyKey`**, and **`executionStrategies`** (`resolveRunTaskRuntimeKnobs` / `resolveExecutionStrategies`) — independent dimensions; legacy wiring maps into `narrixMode`.
56
+ 3. If **`narrixMode === "preprocessor"`** and `request.narrix` is set, run the task-level Narrix pre-processor:
57
+ - Resolve the raw record from `executionMemory`, `jobMemory`, or `input`.
58
+ - Run Narrix (ingest + runner).
59
+ - Attach result to `executionMemory._narrix` (or configured field) and mirror to `jobMemory._narrix`.
60
+ - If `narrix.enableWebScope` is `true`, run web scoping and store result in `executionMemory.webContext`.
61
+ 4. Else if **`narrixMode === "handler"`**, run structured Narrix from `narrixInput` (same behavior as legacy `narrix-then-direct` Narrix phase), **before** local tasks and pipeline PRE.
62
+ 5. Check local task registry for `skillKey`.
63
+ 6. If local handler exists, execute it and return immediately (skip enrichment/LLM path).
64
+ 7. Inject `bindingDefaultsDb` routing default.
65
+ 8. Enrich memory bundle with task-scoped enrichment.
66
+ 9. Build prompt context only when `includeContextInPrompt === true`:
67
+ - With Narrix in play: use Narrix context markdown and optional web evidence markdown.
68
+ - Without Narrix in play: use generated context markdown plus any `taskMemory.narrix` section.
69
+ 10. Build enriched executor input.
70
+ 11. Execute:
71
+ - If `executionPipeline` exists: run PRE steps, one MAIN step, then POST steps.
72
+ - Otherwise run direct MAIN execution path.
73
+ 12. If content/skill is missing, invoke registry diagnostics via not-found handler.
74
+ 13. Return final response (`rawText`, `parsed`, `metadata`, optional `intermediateSteps`).
75
+
76
+ ## Notes
77
+
78
+ - Default execution is effectively direct when no pipeline is provided.
79
+ - Local tasks are deterministic and bypass LLM execution.
80
+ - Web scoping is non-fatal: Narrix attachment can still succeed when web scope misses/fails.
81
+ - POST steps (`audit`, `polish`) run only when declared in `executionPipeline`.
82
+ - For PRE `synthesized-context`, structured mode is additive and template-core-aware (`templateCores` + question), while markdown mode remains available for backward compatibility.
83
+ - Structured core discovery is pre-render from raw instructions/prompt templates and expects core directives in `{{core:...}}` form.
84
+ - PRE `synthesized-context` can control synthesizer input via `SynthesisConfig.synthesisInputStrategy` (`policy`, `execution-memory-only`, `job-memory-only`, `task-memory-only`, `full-memory-bundle`).
85
+ - Pipeline responses expose synthesis audit metadata (`synthesisEnabled`, `effectiveExecutionPipeline`, `synthesizedContextPresent`, `mainContextSource`, `detectedTemplateCores`) and normalized execution state (`executionMemory`, `executionState.executionMemory`).
86
+
87
+ ## Pipeline semantics (context vs input, PRE/POST, and response shape)
88
+
89
+ These details matter for orchestrators and for debugging “why doesn’t my synthesis show up in `input`?”
90
+
91
+ ### Supported `executionPipeline` step types (runtime)
92
+
93
+ - **PRE:** Only `synthesized-context` (`SYNTHESIZED_CONTEXT`) is executed. The runner processes PRE steps in order but **stops after the first** matching synthesized-context step (`break`). Other `phase: "pre"` step types **throw** at runtime.
94
+ - **MAIN:** Exactly one step with `phase: "main"` — otherwise `runTask` **throws** (existing rule).
95
+ - **POST:** Only `audit` and `polish` are executed when their `type` matches. Other `phase: "post"` types are **not executed** (no error today).
96
+
97
+ If you need a new PRE/POST kind, extend `runTask` in `task-sdk.ts`.
98
+
99
+ ### Catalox, Xynthesis, and pipeline metadata (no extra logic in ai-tasks)
100
+
101
+ PRE/POST step identifiers and related configuration are expected to stay **aligned with Catalox content** that owns that metadata. Xynthesis and the catalog layer keep that data consistent; callers and upper layers that build `executionPipeline` from the **same shared metadata** should already see the correct step list. **`@exellix/ai-tasks` does not re-validate or re-sync Catalox IDs** here — it only implements the execution paths above. Use tests or upstream tooling if you need to assert catalog shape beyond what `runTask` runs.
102
+
103
+ ### Synthesis output vs skill `input`
104
+
105
+ When a PRE `synthesized-context` step runs, its markdown (or structured artifact rendered to markdown) becomes **`overrideContext`** for the MAIN pass. In `_executeDirect`, that value is assigned to **`context`** on the object passed to the executor — **not** to `input`.
106
+
107
+ - **`input`:** Still the task request’s payload (plus optional `aiScoped` merges when AI scoping is enabled).
108
+ - **`context`:** Prompt context markdown (synthesis when configured, otherwise legacy/Narrix/scoping-generated context). After synthesis, `appendExternalWebContextMarkdown` may **append** additional web context, so the string MAIN sees can be **synthesis + web**, not necessarily identical to `executionMemory.synthesizedContext.contextMarkdown` alone.
109
+
110
+ ### POST steps and captured context
111
+
112
+ - **Audit** always receives the **same** context string that was captured for MAIN (`capture.contextMarkdown` after MAIN context preparation), and on **audit re-run cycles** the evaluator’s `promptContext` tracks the **effective** context MAIN used for the candidate being scored (including feedback-injected re-runs).
113
+ - **Polish** receives `currentOutput` (MAIN output or output after prior POST steps). It only receives that captured context as `promptContext` when polish config sets **`includeOriginalContext: true`**; otherwise polish does not see synthesis/context markdown.
114
+
115
+ ### Response after POST steps
116
+
117
+ When any POST step runs, the SDK sets both **`rawText`** and **`parsed`** to the final string pipeline output (`currentOutput`). If MAIN returned structured **`parsed`** (e.g. JSON object), that object is **replaced** by the POST text output. Consumers that need the original structured MAIN result must retain it from an earlier response or store it outside this final shape.
118
+
119
+ ### PRE Xynthesis only with a pipeline
120
+
121
+ Without an `executionPipeline` that includes PRE `synthesized-context`, **no** PRE synthesis path runs; MAIN uses the normal direct context path (legacy context markdown, Narrix, etc.). The same `skillKey` can therefore behave differently depending only on whether a pipeline is present.
122
+
123
+ ### Diagram: pipeline data flow (actual)
124
+
125
+ ```mermaid
126
+ flowchart LR
127
+ subgraph pre [PRE]
128
+ SC[synthesized-context]
129
+ SC --> CM[contextMarkdown]
130
+ end
131
+ subgraph main [MAIN]
132
+ S[executor.execute]
133
+ end
134
+ subgraph post [POST]
135
+ A[audit / polish]
136
+ end
137
+ CM -->|"overrideContext + optional web append"| CTX[context]
138
+ CTX --> S
139
+ INP[input] --> S
140
+ CTX -->|"capture.contextMarkdown"| A
141
+ S -->|"rawText / parsed"| A
142
+ A -->|"final string"| OUT[rawText and parsed]
143
+ ```
144
+
145
+ ## Diagnostics, trace mode, and observability digest
146
+
147
+ **Current `runTask` implementation (`task-sdk.ts`)** does **not** implement **`request.diagnostics`**, **`appendRunLog`**, **`RunLogEntry` buffering**, or a Logxer-shaped sink on the request. Orchestrators that merge **`runLog`** / **`exellixRunLog`** / **`logxerRunId`** / **`logxerCorrelationId`** into **`response.metadata`** own that contract — see [.docs/investigation/external-packages-assignments.md](../.docs/investigation/external-packages-assignments.md).
148
+
149
+ - **`executionMode: "trace"`**: forwards trace-related flags to **`@exellix/ai-skills`** `runSkill`; see **`RunSkillDiagnostics`** / **`SkillDiagnosticsTrace`** on that package. Structured **SDK log lines** use **`@x12i/logxer`** from ai-skills execution — not the orchestrator run-log row shape.
150
+ - **`extractAiTasksObservabilityFromRunTaskResponse`**: builds a versioned **`AiTasksObservabilityDigest`** from `metadata` + execution memory for graph UIs (optional attachment).
151
+ - **`response.aiTasksObservability`**: not set by the SDK by default; orchestrators may attach the digest from the extractor.
152
+
153
+ **Future:** if **`request.diagnostics` / `appendRunLog`** are added to **`@exellix/ai-tasks`**, update this section and **`RUNTASK_REQUEST.md`** together.
@@ -0,0 +1,109 @@
1
+ # Checklist: `@exellix/ai-tasks` — single `runTask` validation
2
+
3
+ **Scope:** One task node, end-to-end: validate a single `runTask` execution with structured synthesis and MAIN consumption.
4
+
5
+ **Package context:** PRE steps can include `synthesized-context`; MAIN runs after PRE. Observability is attached on the response as `metadata` (and `meta` alias), including flags such as `synthesizedContextPresent`, `mainContextSource`, and `detectedTemplateCores`.
6
+
7
+ ## Design stance: no backward compatibility
8
+
9
+ **Backward compatibility with legacy context assembly is not a goal for this stack.** The checklist assumes structured synthesis and MAIN consumption of `executionMemory.synthesizedContext` as the normal, required path.
10
+
11
+ Today **only one package upstream** still relies on legacy behavior; that integration is expected to be corrected there using this document as the contract for what “good” looks like. Do not preserve or design around legacy paths for other callers—there are none.
12
+
13
+ Legacy signals in code or metadata (for example `mainContextSource === "legacy"`, primary `webContextMarkdown`, raw Narrix-as-context) are **diagnostics only** (misconfiguration or upstream not yet aligned with this checklist). They are **not** pass criteria and **not** a surface we commit to keeping stable.
14
+
15
+ ---
16
+
17
+ ## 1. Template core detection
18
+
19
+ | # | Check | How to validate | Pass |
20
+ |---|--------|-----------------|------|
21
+ | 1.1 | Resolved template is the real source of task semantics | Trace which template/skill resolved for the run; confirm it matches the intended task definition (not a stale or default template). | |
22
+ | 1.2 | Core tokens come from the **template**, not from free-form request input | Inspect core discovery path: cores should be derived from rendered template content (e.g. `discoverTemplateCores`), not from arbitrary client fields unless explicitly documented. | |
23
+ | 1.3 | Detected core set is visible in logs, traces, or debug output | Confirm `detectedTemplateCores` (or equivalent) appears in tracing/phase metadata or debug logs for the PRE step. | |
24
+ | 1.4 | Behavior when **no** core tokens are found | Run a template with no detectable cores; document expected behavior (empty `templateCores`, synthesis contract, warnings). No silent mis-assumption that cores exist. | |
25
+ | 1.5 | **Multiple** cores preserved | Template with several cores → artifact / observability lists all distinct cores, order stable or documented. | |
26
+
27
+ ---
28
+
29
+ ## 2. Structured synthesis execution
30
+
31
+ | # | Check | How to validate | Pass |
32
+ |---|--------|-----------------|------|
33
+ | 2.1 | PRE synthesized-context **actually runs** | Trace `phase: pipeline_pre`, `preStepType: synthesized-context` (or equivalent) completes without skip. | |
34
+ | 2.2 | Synthesis runs **before** MAIN | Ordering: PRE steps complete, `executionMemory` updated, then MAIN step executes. | |
35
+ | 2.3 | Synthesis input includes | Verify synthesizer payload / source material includes: **resolved question**; **detected template core set**; **raw/enriched local context**; **raw/enriched supporting context** (per `contextSourcePolicy` / `synthesisInputStrategy`). | |
36
+ | 2.4 | Synthesis goes through **ai-gateway** | Network/trace shows gateway route for the synthesis model call, not a bypass. | |
37
+ | 2.5 | Effective mode is **structured**, not fallback markdown assembly | `synthesisMode` / `synthesisOutputFormat` resolves to structured path; response parses as structured payload (e.g. validated JSON contract), not only legacy section markdown. | |
38
+
39
+ ---
40
+
41
+ ## 3. Synthesized artifact creation
42
+
43
+ | # | Check | How to validate | Pass |
44
+ |---|--------|-----------------|------|
45
+ | 3.1 | `executionMemory.synthesizedContext` is produced | Inspect `request`/`result` execution memory after PRE. | |
46
+ | 3.2 | Exists **after PRE** and **before MAIN** | Breakpoint or ordered logs: artifact present when MAIN starts. | |
47
+ | 3.3 | Shape is **structured** (not “only markdown”) | Artifact has structured fields (e.g. validated `payload`, `templateCores`), not solely a prose blob. | |
48
+ | 3.4 | Meaningful **synthesized** local/supporting outputs | Content is distilled/structured per contract, not a verbatim dump of raw Narrix/web/memory. | |
49
+ | 3.5 | **Canonical** key; no duplicate competing keys | Single authoritative `synthesizedContext` on `executionMemory`; no shadow copies under undocumented alternate paths. | |
50
+
51
+ ---
52
+
53
+ ## 4. MAIN input path
54
+
55
+ | # | Check | How to validate | Pass |
56
+ |---|--------|-----------------|------|
57
+ | 4.1 | MAIN consumes `executionMemory.synthesizedContext` | Code path / logs: MAIN context build reads the artifact. | |
58
+ | 4.2 | MAIN does **not** primarily rely on legacy assembled context | When structured path is active, dominance is not `webContextMarkdown`, raw Narrix markdown, or raw dumps alone. | |
59
+ | 4.3 | Final prompt/messages to MAIN **reflect** synthesized payload | Diff or capture: sections/content align with structured synthesis output (e.g. built markdown from structured payload if that’s the bridge). | |
60
+ | 4.4 | No **silent** fallback to old prompt construction | For runs that should pass this checklist, `mainContextSource === "legacy"` means the integration is wrong—fix upstream (request shape, pipeline, flags), not paper over it. Silent degradation without observable flags is unacceptable. | |
61
+
62
+ ---
63
+
64
+ ## 5. Local-first behavior
65
+
66
+ | # | Check | How to validate | Pass |
67
+ |---|--------|-----------------|------|
68
+ | 5.1 | Synthesized output **prioritizes** task/local/runtime facts over supporting web | Ordering and emphasis in structured local vs supporting sides; policy matches product intent. | |
69
+ | 5.2 | Final answer **reflects** runtime-grounded facts first | Answer cites or follows execution/task memory before generic web summaries when both exist. | |
70
+ | 5.3 | Not generic “public summary” when local should dominate | Deliberate fixture: strong local signal + web noise → answer anchored locally. | |
71
+ | 5.4 | Supporting context stays **supportive** | Web/supporting material does not override or swamp local conclusions. | |
72
+
73
+ ---
74
+
75
+ ## 6. Reporting and observability
76
+
77
+ | # | Check | How to validate | Pass |
78
+ |---|--------|-----------------|------|
79
+ | 6.1 | Reports show whether **synthesis ran** | e.g. `synthesisEnabled`, pipeline/effective pipeline, or PRE phase completion in report payload. | |
80
+ | 6.2 | Reports expose **detected template cores** | e.g. `detectedTemplateCores` in `metadata` / report mirror. | |
81
+ | 6.3 | Reports show **`synthesizedContext` created** | e.g. `synthesizedContextPresent`. | |
82
+ | 6.4 | Reports show **MAIN used synthesized input** | e.g. `mainContextSource === "synthesizedContext"` (and related flags if any). | |
83
+ | 6.5 | If missing in reports, classify **reporting gap vs runtime failure** | Compare raw trace/logs to report: runtime correct but UI/report omits field → omission only; no artifact in memory but report says OK → failure. | |
84
+
85
+ ---
86
+
87
+ ## 7. Pass criteria (single `runTask`)
88
+
89
+ A single run **passes** only if **all** are true:
90
+
91
+ 1. **PRE synthesis ran** — synthesized-context PRE completed as intended.
92
+ 2. **Template cores were detected** — non-empty when the template defines detectable cores; empty case matches documented behavior for that template.
93
+ 3. **`executionMemory.synthesizedContext` exists** — structured artifact present before MAIN.
94
+ 4. **MAIN used synthesized payload** — `mainContextSource` (or equivalent) indicates synthesized path, not unintended legacy.
95
+ 5. **Observability shows that clearly** — synthesis, cores, artifact presence, and MAIN source are visible in metadata/traces/reports.
96
+ 6. **Final output is task-grounded and local-first** — answer quality matches sections 4–5 for the fixture used.
97
+
98
+ ---
99
+
100
+ ## Quick reference (response `metadata`)
101
+
102
+ When validating, confirm at least:
103
+
104
+ - `detectedTemplateCores`
105
+ - `synthesizedContextPresent`
106
+ - `mainContextSource` (`"synthesizedContext"` vs `"legacy"`)
107
+ - `synthesisEnabled` / `effectiveExecutionPipeline` as appropriate for your environment
108
+
109
+ Treat `"legacy"` `mainContextSource` when a synthesized PRE ran and an artifact exists as a **red flag**: fix the caller (the remaining upstream package should converge on this checklist), not `ai-tasks`.