feat(dv2): bv_order_canonical PostgreSQL smoke seed + verify (G1)#152
Merged
Conversation
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>
DORA Metrics
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
G1 (endgame plan) — the
bv_order_canonicallive smoke artifact. The DV2 vault's governance verify seeds and exercises only the customer side (bv_customer_mdm); the reconstruction-heavybv_order_canonicalview 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 ClickHousesynthetic_seed.sqlconventions ported to the PG idiom (decode(md5(bk),'hex'),ON CONFLICT DO NOTHING). Covers:UNION(Bitrix beats an older cross-source 1C header) + per-satellite pricing/marketplace collapseis_deleted=1) that must not win over the older active versionwbsatellite the production seed never populated (new coverage)LEFT JOINmiss (ala has a header but no 1C pricing)split_partbranch derivationverify_bv_order.sh— applies the seed and asserts 17 invariants againstbv_order_canonical(PASS/FAIL, PostgreSQL-owner recipe,APPLY=1runsapply.shfirst).README.md— Mac run recipe, hand-derived expected output table, honest scope.Verification
order_smoke_seed.sqlis parsed under sqlglot's PostgreSQL dialect and checked for stray ClickHouse constructs by 3 new tests intest_dv2_postgres_ddl.py— 28/28 green locally, ruff clean.DISTINCT ON/split_part/LEFT JOIN) — 17/17.docs/perf/bv-order-canonical-pg-smoke-*.md.🤖 Generated with Claude Code