1.6 KiB
1.6 KiB
Refresh Strategy (Layer 3)
Date: 2026-03-23
Status: MVP implementation available (canonical_layer/refresh.py)
1. Goal
Provide controlled extraction from 1C into canonical store with reproducible runs, checkpoints, and operational audit trail.
2. Refresh modes
Historical
- bootstrap population of canonical store
- wide scan of selected entity sets
- used to build initial baseline
Incremental
- regular updates for open periods
- optional date window (
date_from,date_to) - preferred default daily mode
Targeted
- selective refresh for one account/document/counterparty context
- optional
target_idtext filter - used for point recovery and drill-down gaps
3. Runtime behavior
- Resolve entity sets (explicit list or keyword-based discovery).
- Read records from 1C OData per entity set (bounded by
limit_per_set). - Apply optional date and targeted filters.
- Map rows to canonical entities and links.
- Upsert entities/links to canonical store.
- Update checkpoints for successful sets.
- Persist run status and metrics into
refresh_runs.
4. Run statuses
success: all requested sets processedpartial_success: at least one set processed, at least one failedfailed: no sets processed successfully
5. Execution interfaces
CLI:
python scripts/run_refresh.py --mode incremental ...
PowerShell wrapper:
scripts/run_refresh.ps1
API:
POST /refresh/runGET /refresh/runsGET /store/stats
6. Safety constraints
- Read-only integration policy stays unchanged.
- No write-back into 1C.
- Local canonical store is internal analytical cache, not source of truth.