Skip to content

feat(dv2): generator + seeds rebuild for the kitchen-appliance legend (B1) - #138

Merged
brownjuly2003-code merged 2 commits into
mainfrom
b1-generator-seeds-kitchen-legend
Jul 3, 2026
Merged

feat(dv2): generator + seeds rebuild for the kitchen-appliance legend (B1)#138
brownjuly2003-code merged 2 commits into
mainfrom
b1-generator-seeds-kitchen-legend

Conversation

@brownjuly2003-code

Copy link
Copy Markdown
Owner

Summary

  • Rewrites reference/generator.py + reference/tnved.py: own-brand kitchen-appliance reference (30 suppliers — 22 CN/5 RU/2 AE/1 KZ; 160 SKUs across 10 categories; FOB<landed<wholesale<mp-net<RRC pricing ladder; no brand token; CN USCC-18 clearly labelled as a structural placeholder, not GB 32100-2015 verified).
  • New reference/legend.py: single numeric source of truth (master matrix, seasonal curves, dealer/retail populations, pricing bands) shared by the generator and the invariant tests.
  • Rewrites synthetic_seed.sql, satellite_seed.sql, satellite_seed_all_branches.sql, postgres_oltp/seed.sql, cold_offload_seed.sql to the new legend: 2,500 customers (2,000 retail + 500 dealers banded by branch), 160 products, 10,000 orders split mp/site/B2B by branch, dealer-only retro-bonus loyalty in msk/spb/ekb, faux-PII locale rules per jurisdiction, ~12,000 per-unit Chestny Znak marking-code sample.
  • New tests/unit/test_generator_spec_invariants.py encodes generator-spec.md §12's 12 consistency invariants as machine-checkable tests (arithmetic over legend.py + generated-catalog checks + structural checks over the seed SQL text).

Notes

  • Found and resolved one internal inconsistency in generator-spec.md: §1's master matrix pins dxb's B2B avg check at 90k ₽, outside §12 invariant Chaos scheduled run failed — 2026-05-03 #4's general [30k,80k] B2B band. Read narrowly (dxb is a documented, table-explicit re-export outlier); test comment explains the reasoning.
  • Live ClickHouse/Postgres re-verify of the seed SQL is B4's job (no Docker in this dev environment) — this PR is scoped to what's testable without a live warehouse: the generator's Python output and the arithmetic/structural invariants.
  • Out of scope (later phases per plan_endgame): x5__*mp__* rename elsewhere in the codebase (B2), demo-store repin (B3), demo_evidence/live-verify regeneration (B4), docs sweep (C1).

Test plan

  • pytest tests/unit/test_dv2_supplier_reference.py tests/unit/test_generator_spec_invariants.py tests/unit/test_dv2_postgres_ingestion.py — 91 passed
  • pytest tests/unit (full suite) — 1589 passed
  • ruff check / ruff format --check / mypy on all changed Python files — clean
  • Live ClickHouse/Postgres seed apply + verify_live recount (B4, needs a live stand)

🤖 Generated with Claude Code

… (B1)

Replaces the grocery/X5 reference generator and DV2 demo seeds with the
own-brand kitchen-appliance importer legend pinned in docs/domain.md and
docs/generator-spec.md: 30 suppliers (22 CN/5 RU/2 AE/1 KZ), 160 SKUs across
10 categories with a FOB<landed<wholesale<mp-net<RRC pricing ladder, and
DV2 seeds recalibrated to 2,500 customers (2,000 retail + 500 dealers),
10,000 orders split by channel/branch, and dealer-only retro-bonus loyalty
in msk/spb/ekb. New reference/legend.py is the single numeric source of
truth; tests/unit/test_generator_spec_invariants.py encodes generator-spec.md
§12's 12 consistency invariants as machine-checkable tests.

Live ClickHouse/Postgres re-verify of the rewritten seed SQL is B4's job
(no Docker available in this environment); this pass is scoped to the
generator, seeds, and everything testable without a live warehouse.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

DORA Metrics

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

CI's float summation of SEASONAL_B2B lands at 12.000000000000002 instead
of 12.0 (non-associative float addition, platform-dependent rounding) —
exact equality on a float sum was never safe to begin with.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@brownjuly2003-code
brownjuly2003-code merged commit 4437e9c into main Jul 3, 2026
19 checks passed
@brownjuly2003-code
brownjuly2003-code deleted the b1-generator-seeds-kitchen-legend branch July 3, 2026 13:33
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