feat(cv-import): add source-grounded review and explicit corrections

This commit is contained in:
cesnimda
2026-10-26 15:56:54 +01:00
parent 9e1726c61d
commit e941b3ccb7
24 changed files with 943 additions and 48 deletions
@@ -219,7 +219,8 @@ public sealed partial class ProfileCvController : ControllerBase
.Where(x => x.OwnerUserId == user.Id);
var isSqlite = _db.Database.IsSqlite();
if (!isSqlite)
runsQuery = runsQuery.OrderByDescending(x => x.StartedAtUtc).Take(10);
runsQuery = runsQuery.OrderByDescending(x => x.StartedAtUtc).Take(10)
.Union(_db.CvExtractionRuns.AsNoTracking().Where(x => x.OwnerUserId == user.Id && x.Status == "pending_review"));
var runs = await runsQuery.Select(x => new CvExtractionRunListItem(
x.Id,
x.Trigger,
@@ -233,8 +234,8 @@ public sealed partial class ProfileCvController : ControllerBase
x.LlmPromptVersion,
x.ErrorMessage,
null)).ToListAsync(HttpContext.RequestAborted);
if (isSqlite)
runs = runs.OrderByDescending(x => x.StartedAtUtc).Take(10).ToList();
runs = runs.OrderByDescending(x => x.StartedAtUtc).Take(10).Concat(runs.Where(x => x.Status == "pending_review"))
.DistinctBy(x => x.Id).OrderByDescending(x => x.StartedAtUtc).ToList();
var runIds = runs.Select(run => run.Id.ToString(System.Globalization.CultureInfo.InvariantCulture)).ToList();
var operations = await _db.UserOperations.AsNoTracking()