Контекст
Vehicle appraisal was a chain of human document reading, spreadsheet pricing, and PDF assembly. Banks needed a repeatable valuation with an audit trail, not a desk process that drifted per operator.
Граница системы
В системе
- document intake
- OCR
- VIN validation
- market comparables
- valuation
- generated reports
- bank handoff
Вне системы
- physical inspection hardware
- lender underwriting decisions
Архитектура
A FastAPI service owns ingestion and valuation. OCR and VIN checks are isolated stages so a document failure does not contaminate pricing. Generated PDFs are artifacts, not the source of truth; the valuation record is.
- Market source
- Ingestion
- OCR
- VIN validation
- Valuation
- Documents
- Banking API
- Source → transform → sink
- Last node is the handoff
- Market source
- Ingestion
- OCR
- VIN validation
- Valuation
- Documents
- Banking API
Счётчики из опубликованной записи. Они описывают структуру, а не измеренный результат.
Где проверка превращается в отчёт?
inputs
- внешнийMarket source
pipeline
- сервисIngestion
- процессOCR
- процессVIN validation
- процессValuation
records
- хранилищеDocuments
handoff
- интерфейсBanking API
- Market sourceIngestion
- IngestionOCR
- OCRVIN validation
- VIN validationValuation
- ValuationDocuments
- DocumentsBanking API
Критические потоки
A document pack arrives
pages are classified
OCR extracts identity fields
VIN is validated against registry rules
comparables are scored
a valuation is written
a report is generated
the bank API receives a signed payload.
Этапы
Решения
Stage the pipeline
Each stage writes an explicit record. Replay and audit are cheaper than a single opaque job.
Keep valuation deterministic
Market adapters are versioned. A valuation cites the data vintage used, not “whatever the API returned today”.
Treat PDFs as exports
The report is a projection of the valuation record. Correcting a number means regenerating the artifact, not editing a file.
Когда что-то ломается
| Условие | Обнаружение | Реакция |
|---|---|---|
| Unreadable or mixed-language documents | OCR confidence + required-field presence | Hold for operator review; do not price |
| VIN checksum or registry mismatch | Validation stage reject | Stop pipeline; flag identity exception |
| Stale or missing market comparables | Adapter freshness window | Degrade to manual pricing queue |
| Bank API timeout or schema reject | Handoff status + retry budget | Retry with backoff; keep local valuation intact |
Инфраструктура
- Linux hosts
- reverse proxy
- object storage for packs and reports
- worker queue for OCR and generation
- structured logs per stage
Результат
End-to-end appraisal runs as a recorded pipeline. Banks receive a generated pack tied to a valuation record rather than a one-off PDF.
Текущее состояние
In production. New document types and lender schemas are added as stages, not as forks of the valuation core.