- Shipped
- July 15, 2026 at 3:26 AM UTC
- Author
- Kamo
- Commit
- 807a235
- Concurrency: in-process activeOrgs guard + the DB claim() so this instance never double-walks an org and two replicas can't overlap; a run whose heartbeat is >10min stale is reclaimable (process died mid-walk). - Idempotency: skip loans already marked closedLoanTrainedAt, and mark a loan only after a real closed-loan training pass (not-yet-closed loans stay unmarked so later passes catch them once they close). - Memory safety: skip documents over 30MB — downloadDocument buffers the whole file and SecurityService is memory-tight. - Signed-URL TTL for training docs is now configurable and defaults to 15min so a slow 15-page vision read can't outrun a 5-min token.