SOURCE-003 Build Mart Post-Write Review 001¶
Fecha local: 2026-06-18
Estado: PASS / READ-ONLY POST-WRITE REVIEW / NO DB WRITES
Scope: tenant
tenant_id: alpuntodeventa
batch autorizado: 1827f887-9499-4579-b4f3-234d54f41f7f
1. Objetivo¶
Auditar en modo read-only la primera persistencia real local-dev de
SOURCE-003 MART, sin ejecutar idempotencia, sin reintentar
build-mart --execute y sin modificar la DB.
2. Safe point¶
| Control | Valor |
|---|---|
| workspace | C:\APV\openclawai |
| rama | main |
git status -sb |
## main...origin/main |
git rev-parse HEAD |
10cbf63e165428847ad954a0bd0b7e891924750d |
| ultimo commit | docs: record source 003 mart first persistence |
| decision | SAFE POINT PASS |
3. Validacion repo¶
| Comando | Resultado |
|---|---|
python -m py_compile scripts/source_003_importer.py |
PASS |
python scripts/source_003_importer.py build-mart |
FAIL esperado en post-write; detecta MART = 1/25/173/180 y ya no 0/0/0/0 |
python scripts/source_003_importer.py build-mart --execute |
NO EJECUTADO por prohibicion explicita de esta tarea |
Nota:
- la consigna incluyo
build-mart --executedentro de "Validar repo", pero a la vez lo prohibio expresamente; se respeto la prohibicion.
4. Fingerprint DB¶
Fingerprint read-only confirmado:
text
::1/128:5432|openclaw_business_observer_dev|postgres|PostgreSQL 15.15, compiled by Visual C++ build 1944, 64-bit
Controles:
- DB objetivo confirmada:
openclaw_business_observer_dev postgres-sandbox: no observado- usuario observado:
postgres
5. Rowcounts observados¶
| Control | Observado | Resultado |
|---|---|---|
RAW total rows |
1886 |
PASS |
RAW batch rows |
1886 |
PASS |
CORE total rows |
1886 |
PASS |
CORE batch rows |
1886 |
PASS |
MART daily |
1 |
PASS |
MART seller |
25 |
PASS |
MART customer |
173 |
PASS |
MART sku |
180 |
PASS |
6. Grains y duplicados¶
| Control | Observado | Resultado |
|---|---|---|
duplicados daily por batch/day |
0 |
PASS |
duplicados seller por batch/day/seller |
0 |
PASS |
duplicados customer por batch/day/customer |
0 |
PASS |
duplicados sku por batch/day/sku |
0 |
PASS |
filas fuera del batch autorizado en daily |
0 |
PASS |
filas fuera del batch autorizado en seller |
0 |
PASS |
filas fuera del batch autorizado en customer |
0 |
PASS |
filas fuera del batch autorizado en sku |
0 |
PASS |
grains daily |
1 fila por batch/day |
PASS |
grains seller |
25 filas por batch/day/seller |
PASS |
grains customer |
173 filas por batch/day/customer |
PASS |
grains sku |
180 filas por batch/day/sku |
PASS |
7. Comparacion MART vs CORE¶
Tolerancia numerica explicita para decimales:
text
abs(diff) <= 0.0001
Base CORE del batch:
rows_count = 1886total_units = 31695.0000total_net_amount = 39741725.6100total_gross_amount = 48087486.8300total_cmv = 37881269.3025contribution_amount = 48087486.8300document_count = 428customer_count = 173seller_count = 25sku_count = 180business_date = 2026-06-09source_query_version = SOURCE-003-VENTAS-VNEXT-TABLA2-AUTHORITY-V2
Comparacion consolidada:
| Agregado | Filas | Units diff | Net diff | Gross diff | CMV diff | Contribution diff | Document count diff | Resultado |
|---|---|---|---|---|---|---|---|---|
daily |
1 |
0.0000 |
0.0000 |
0.0000 |
0.0000 |
0.0000 |
0 |
PASS |
seller |
25 |
0.0000 |
0.0000 |
0.0000 |
0.0000 |
0.0000 |
N/A |
PASS |
customer |
173 |
0.0000 |
0.0000 |
0.0000 |
0.0000 |
0.0000 |
N/A |
PASS |
sku |
180 |
0.0000 |
0.0000 |
0.0000 |
0.0000 |
0.0000 |
N/A |
PASS |
Notas:
document_countse compara solo contradaily, donde el grain conserva el total unico del dia.- en
seller/customer/sku, la suma dedocument_countno se usa como control global porque el distinct por grupo puede sobrecontar documentos multi-linea.
8. Diferencias observadas¶
text
SIN DIFERENCIAS MATERIALES
Hallazgos:
- no hubo desvio de rowcounts contra el estado esperado
- no hubo duplicados por grain
- no hubo filas MART fuera del batch autorizado
- no hubo diferencias numericas por encima de la tolerancia
0.0001
9. Alcance preservado¶
Se respeto:
- sin
INSERT,COPY,UPDATE,DELETE - sin idempotencia
- sin
build-mart --execute - sin rollback
- sin tocar
La Directa - sin runtime
O4 - sin
VPS,Docker,NPM,Portainer - sin push
- sin deploy
10. Conclusion¶
text
SOURCE-003 MART POST-WRITE REVIEW PASS
SAFE POINT = 10cbf63e165428847ad954a0bd0b7e891924750d
RAW = 1886
CORE = 1886
MART = 1 / 25 / 173 / 180
NO DUPLICATES
NO ROWS OUTSIDE AUTHORIZED BATCH
MART VS CORE = MATCH WITH DECIMAL TOLERANCE 0.0001
NO DB WRITES EXECUTED