Cache closed-loan docs across passes; retire on solve/exhaust

FeatureSecurityService
Shipped
July 15, 2026 at 6:07 PM UTC
Author
Kamo
Commit
45e5a00

The trainer now refines a loan over multiple passes instead of one-and-done: - TrainingDocStore is a PERSISTENT, deterministically-keyed cache (key = hash of org|loan|docId). A document is downloaded from MeridianLink ONCE and reused from MinIO on every later pass — the expensive, rate-limited, vendor-dependent download never repeats. - trainLoan runs one pass: cached-once fetch → extract → diff each mapped field vs the SoR value, UPSERTing one label per loan-field. - A loan is retired when SOLVED (a pass matched every mapped field) or EXHAUSTED (hit training.max-passes-per-loan, default 5); on retire its cached docs are purged so closed-loan PII is cached only while we're still working the loan, never archived.

All changes

Like what you see shipping?

Every one of these updates lands in your workspace automatically. Start free and watch it grow week after week.

Start Free ForeverView Pricing