Skip to content

feat(dv2): bv_order_canonical PostgreSQL smoke seed + verify (G1)#152

Merged
brownjuly2003-code merged 1 commit into
mainfrom
feat/g1-bv-order-smoke
Jul 4, 2026
Merged

feat(dv2): bv_order_canonical PostgreSQL smoke seed + verify (G1)#152
brownjuly2003-code merged 1 commit into
mainfrom
feat/g1-bv-order-smoke

Conversation

@brownjuly2003-code

Copy link
Copy Markdown
Owner

What

G1 (endgame plan) — the bv_order_canonical live smoke artifact. The DV2 vault's governance verify seeds and exercises only the customer side (bv_customer_mdm); the reconstruction-heavy bv_order_canonical view had no PostgreSQL-dialect order seed, so a live query against real order rows was the last unproven vault sub-step.

Changes — warehouse/agentflow/dv2/postgres/smoke/

  • order_smoke_seed.sql — 8 deterministic orders (own-brand kitchen-appliance legend, RUB), one canonical row each. Mirrors the ClickHouse synthetic_seed.sql conventions ported to the PG idiom (decode(md5(bk),'hex'), ON CONFLICT DO NOTHING). Covers:
    • SCD2 latest-wins across the header UNION (Bitrix beats an older cross-source 1C header) + per-satellite pricing/marketplace collapse
    • a soft-delete tombstone (is_deleted=1) that must not win over the older active version
    • marketplace state for MSK only — the wb satellite the production seed never populated (new coverage)
    • a pricing LEFT JOIN miss (ala has a header but no 1C pricing)
    • per-jurisdiction VAT (RU 20 % / UAE 5 %) and split_part branch derivation
  • verify_bv_order.sh — applies the seed and asserts 17 invariants against bv_order_canonical (PASS/FAIL, PostgreSQL-owner recipe, APPLY=1 runs apply.sh first).
  • README.md — Mac run recipe, hand-derived expected output table, honest scope.

Verification

  • CI (no Docker): order_smoke_seed.sql is parsed under sqlglot's PostgreSQL dialect and checked for stray ClickHouse constructs by 3 new tests in test_dv2_postgres_ddl.py28/28 green locally, ruff clean.
  • Logic dry-run: the view reconstruction + all 17 expected values were validated on DuckDB (a real SQL engine, DISTINCT ON/split_part/LEFT JOIN) — 17/17.
  • Remaining sub-step: the live PASS/FAIL run on a single-node Mac stand (the standalone no-Docker recipe from the governance verify applies unchanged). Transcript target: docs/perf/bv-order-canonical-pg-smoke-*.md.

🤖 Generated with Claude Code

The DV2 vault's governance verify seeds and exercises only the customer side
(bv_customer_mdm). bv_order_canonical — the reconstruction-heavy view that
motivates running the vault on PostgreSQL — had no PG-dialect order seed, so a
live query against real order rows was the last unproven vault sub-step.

Add postgres/smoke/:
  - order_smoke_seed.sql: 8 deterministic orders (kitchen-appliance legend,
    RUB), one canonical row each, covering SCD2 latest-wins across the header
    UNION + per-satellite pricing/marketplace collapse, a soft-delete tombstone
    that must not win, marketplace state for MSK only (the wb satellite the
    production seed never populated), a pricing LEFT JOIN miss, per-jurisdiction
    VAT (RU 20% / UAE 5%) and split_part branch derivation.
  - verify_bv_order.sh: applies the seed and asserts 17 invariants against
    bv_order_canonical (PASS/FAIL, PostgreSQL-owner recipe).
  - README.md: Mac run recipe + hand-derived expected output + honest scope.

CI (no Docker): the seed is parsed under sqlglot's PostgreSQL dialect and
checked for stray ClickHouse constructs by three new tests in
test_dv2_postgres_ddl.py. The live PASS/FAIL run on a single-node Mac stand
is the remaining sub-step; the standalone no-Docker recipe from the governance
verify applies unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

DORA Metrics

  • Window: last 30 days
  • Branch: main
  • Deployment frequency: 117 total / 27.3 per week
  • Lead time for changes: avg 0.44h / median 0.0h
  • Change failure rate: 70.94% (83/117)
  • MTTR: 0.29h across 2 incident(s)

@brownjuly2003-code brownjuly2003-code merged commit 2134150 into main Jul 4, 2026
19 checks passed
@brownjuly2003-code brownjuly2003-code deleted the feat/g1-bv-order-smoke branch July 4, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants