fix: retain stock identities in research and AI task lists

This commit is contained in:
2026-10-09 23:08:47 +08:00
parent 9d56f6169a
commit c8c61d29bf
9 changed files with 29 additions and 7 deletions
@@ -95,6 +95,10 @@ func testStrategyBacktest(t *testing.T, ctx context.Context, pool *pgxpool.Pool,
if e != nil || done.Status != "COMPLETED" || done.FinishedAt == nil || len(done.Result) == 0 {
t.Fatalf("completed job: %v", e)
}
listed, e := repo.List(ctx)
if e != nil || len(listed) != 1 || listed[0].Symbol != bi.Symbol || listed[0].Input != nil || listed[0].Result != nil {
t.Fatal("backtest list must retain the symbol without returning large inputs")
}
if _, e := pool.Exec(ctx, `UPDATE veyra_backtest_run SET result='{}'::jsonb WHERE id=$1`, job.ID); e == nil {
t.Fatal("completed result can be overwritten")
}