Hamilton-Jacobi-Bellman under Lévy driven Ornstein Uhlenbeck process

I am trying to solve a HJB equation with terminal condition under mean reverting process (Ornstein-Uhlenbeck process).

I am pretty confused on how to account for the terminal condition and how to guess solution form for the value function.

Here are some details.

Consider two assets with dynamic

\begin{aligned} \frac{dS_t}{S_{t-}} &= \Bigg[\kappa_1(\mu_1-lnS_t) - \lambda_1Z_{1,t}\int z_1\nu_1(dz)\Bigg] dt+\sigma_{1,t}dB_{1,t} + Z_{1,t}dN_{1,t} \qquad \qquad \qquad \quad (1)\\ \frac{dX_t}{X_{t-}} &= \Bigg[\kappa_2(\mu_2-lnX_t) - \lambda_2Z_{2,t}\int z_2\nu_2(dz)\Bigg]dt + \sigma_{2,t}dB_{2,t} + Z_{2,t}dN_{2,t} \qquad \, (2)\\ \end{aligned} where $B_{i,t}$ is Brownian motion with $dB_{1,t}dB_{2,t} = \rho dt$; $N_{i,t}$ is Poisson process independant from $N_{j,t}$, $i\neq j$, and from the Brownian motion $dB_{i,t}$; $i\in\{1,2\}$.

Let the portfolio $V_t$ to be composed of riskless asset and the derivative asset $X_t$ which is used to hedge the underlying asset $S_t$. The portfolio dynamic is given subject to budget constraint by

$$\frac{dV_t}{V_{t-}} = (1-\omega_t)rdt - C_tdt + \omega_t\frac{dX_t}{X_{t-}} \qquad \qquad \qquad (3) \\$$ with $C_t$ the consumption rate. The portfolio becomes \begin{aligned} dV_t &= V_t\Bigg[(r - C_t + \omega_t\kappa_2(\mu_2-lnX_t-r) - \omega_t\lambda_2Y_{2,t}\int z_2\nu_2(dz)\Bigg]dt \qquad (4)\\ &\qquad \quad + \omega_tV_t\sigma_{2,t}dB_{2,t} + \omega_tV_tZ_{2,t}dN_{2,t} \end{aligned}

We have to solve

$$J(V_t,X_t,S_t,t) = \max_{C_s,\omega_s,\;t\leq s\leq T}\mathbf{E}_t\Bigg[\int_t^TU(C_s)ds+g(V_T)\Bigg] \qquad \qquad (5)$$ with $$J(V_T,X_T,S_T,T)= g(V_T) \qquad \qquad (6)$$

Using Ito formula for jump diffusion we have the HJB equation \begin{aligned} 0 &= \max_{\{C_s,\omega_s\}_{t\leq s\leq T}}U(C_t) + J_t \\ &\qquad +J_v\left[V_t\left(r + \omega_t\kappa_2(\mu_2-\ln X_t)-\omega_tr -\omega_t\lambda_2 Z_{2,t}\int z_2\nu_2(dz)\right) -C_t\right] \\ &\qquad +J_x\left[\kappa_2(\mu_2-\ln X_t)-\lambda_2Z_{2,t}\int z\nu_2(dz)\right] +\frac12J_{vv}\omega_t^2V_t^2X^2_t\sigma_{2t}^2 +J_{vx}\omega_tV_tX_t^2\sigma_{2t}^2 \qquad (7)\\ &\qquad +\frac12 J_{xx}X^2_t\sigma_{2t}^2 +\lambda_2\int\Big[J(V_{t-}+V_{t-}\omega_tZ_2z_2,t)-J(V_{t-},t)\Big]\nu_2(dz)\\ &\qquad +\lambda_2\int\Big[J(X_{t-}+X_{t-}Z_2z_2,t)-J(X_{t-},t)\Big]\nu_2(dz) \end{aligned} where $J_t, J_v, J_x$ are first order partial derivative with regard to $t, V_t$ and $X_t$ respectively; and $J_{vv}, J_{xx}, J_{vx}$ the second order partial derivative with regard to $V_t$ and $X_t$ respectively.

Last equation (7) boils down \begin{aligned} 0 &= \max_{\{C_s,\omega_s\}_{t\leq s\leq T}}U(C_t) + J_t \\ &\qquad +J_v\left[V_t\left(r + \omega_t\kappa_2(\mu_2-\ln X_t)-\omega_tr -\omega_t\lambda_2 Z_{2,t}\int z_2\nu_2(dz)\right) -C_t\right] \quad (8)\\ &\qquad +\frac12J_{vv}\omega_t^2V_t^2X^2_t\sigma_{2t}^2 +J_{vx}\omega_tV_tX_t^2\sigma_{2t}^2 \\ &\qquad +\lambda_2\int\Big[J(V_{t-}+V_{t-}\omega_tZ_2z_2,t)-J(V_{t-},t)\Big]\nu_2(dz)\\ \end{aligned}

This last equation (8) can be separate in two optimization problems. The first with regard to $C_t$ as follows $$\max_{C_t}\Big\{U(C_t)-J_vC_t\Big\}=0 \quad \Rightarrow \quad C^*_t = U_C^{-1}\Big(J_v\Big)$$

The second optimization with regard to $\omega_t$ \begin{aligned} 0 &= J_v\left[V_t\left(\kappa_2(\mu_2-\ln X_t)- r -\lambda_2 Z_{2,t}\int z_2\nu_2(dz)\right) \right] +J_{vv}\omega_tV_t^2X^2_t\sigma_{2t}^2 +J_{vx}V_tX_t^2\sigma_{2t}^2 \\ &\qquad +\frac{\partial}{\partial\omega_t}\bigg\{\lambda_2\int\Big[J(V_{t-}+V_{t-}\omega_tZ_2z_2,t)-J(V_{t-},t)\Big]\nu_2(dz)\bigg\}\\ \end{aligned} subject to $$J(V_T,X_T,S_T,T)= g(V_T)$$

From this point it is assumed that the utility function $U$ is CRRA
$$\begin{cases} U(C) = \frac{C^{1-\gamma}}{1-\gamma}, \:\gamma\in(0,1)\cup(1,\infty)\\ U(C) = -\infty, \: C\leq0 \end{cases}$$ and the Lévy measure is given $$\nu_2(dz) = \frac{dz}z, \qquad \text{if}\quad z\in (0,1].$$

I am pretty confused on how to account for the terminal condition $J(V_T,X_T,S_T,T)= g(V_T)$ and how to guess solution form for the value function $J(V_t,X_t,S_t,t)$.