Saltar a contenido

SOURCE-003 Build Mart Write Path Implementation 001

Fecha local: 2026-06-18

Estado: IMPLEMENTADO EN PYTHON / NO EJECUTADO / SIN ESCRITURA DB

Scope: tenant

tenant_id: alpuntodeventa

Owner: Gabi / Carlos Canu

Objetivo

Implementar en scripts/source_003_importer.py la ruta futura de:

powershell python scripts/source_003_importer.py build-mart --execute

sin ejecutarla con escritura real en esta tarea.

Archivos modificados

  • scripts/source_003_importer.py
  • docs/PROJECT-STATE.md
  • docs/ROADMAP.md
  • docs/VALIDATION-MATRIX.md
  • docs/tenants/alpuntodeventa/business-observer/PROJECT-STATE.md
  • docs/tenants/alpuntodeventa/business-observer/ROADMAP.md
  • mkdocs.yml

Implementacion aplicada

  • se agrego el gate duro --confirm-local-dev-write
  • token requerido: SOURCE003_MART_LOCAL_DEV_1886
  • build-mart sin flags sigue en DRY_RUN
  • build-mart --execute sin token queda BLOCKED
  • build-mart --execute --confirm-local-dev-write WRONG_TOKEN queda BLOCKED
  • la ruta execute ahora deja preparado el write path con:
  • fingerprint DB obligatorio
  • abort si aparece postgres-sandbox
  • preflight read-only antes de cualquier write
  • transaccion unica
  • revalidacion intra-transaccion de RAW, CORE, MART y estimates
  • abort si alguna MART ya tiene filas para el mismo batch
  • inserts en orden daily -> seller -> customer -> sku
  • rowcounts esperados 1/25/173/180
  • ROLLBACK total ante error
  • salida JSON estructurada
  • production = false
  • sync_enabled = false

Estado protegido

  • DB objetivo prevista: openclaw_business_observer_dev
  • schema: business_observer
  • batch autorizado: 1827f887-9499-4579-b4f3-234d54f41f7f
  • estado esperado preservado durante esta tarea:
  • RAW = 1886
  • CORE = 1886
  • MART daily/seller/customer/sku = 0/0/0/0
  • estimates 1/25/173/180

Confirmacion de no ejecucion

  • no se uso el token real
  • no se ejecuto build-mart --execute con confirmacion valida
  • no hubo INSERT, COPY, UPDATE, DELETE
  • no hubo escritura real en DB
  • no se modificaron RAW, CORE ni MART
  • no se habilito produccion
  • no se habilito sync diaria

Resultado

text SOURCE-003 BUILD-MART WRITE PATH IMPLEMENTADO EN CODIGO GATE DURO ACTIVO EXECUTE SIGUE BLOCKED SIN TOKEN EXACTO NO EJECUTADO SIN ESCRITURA DB NO APTO PARA PRODUCCION NO APTO PARA SYNC DIARIA