Repository navigation
v2.0.0 — Evidence Gate for Data Warehouse Changes
Review warehouse changes with evidence your team can reproduce.
让每次数仓变更都带着团队可以复跑的验收证据。
English · 中文 · Quick start / 快速上手 · PyPI
English
Two orders swap amounts. The row count and total revenue still match. dw reconcile catches the difference at the business-key level, and dw check gives reviewers a record of what passed, what failed, and what still needs verification.
dw-harness 2.0 brings SQL linting, table contracts, reconciliation, and release checks into a Claude Code plugin and a standalone CLI. It is designed around MaxCompute → StarRocks, with SQL linting for Hive and Spark as well.
What's new
- Table contracts. Version business keys, partition rules, column types, currency and units, and quality thresholds. Breaking changes require a recorded migration decision.
- Key-level reconciliation. Compare datasets at the business-key level with decimal arithmetic, unit conversion, and configurable tolerances.
- Evidence for CI. Get
PASS,FAIL,UNVERIFIED, andN/Areports. Evidence is tied to the inputs, environment, and partition it verified. - SQL guardrails. Apply project rules through
dw lintand Claude Code hooks. Pre-execution checks cover recognized Bash and PowerShell database commands.
Upgrading from v1
Plugin commands use the dw-harness: namespace, for example /dw-harness:dw-etl. Preview the merge-based migration with dw init --dry-run and regenerate evidence created before 2.0. See the migration guide.
中文
两笔订单的金额互换,总行数、总金额都没变。dw reconcile 能按业务键定位差异,dw check 则把通过项、失败项和未验证项汇总成一份可审查的验收报告。
dw-harness 2.0 将 SQL 校验、表契约、逐键对账和变更验收做成 Claude Code 插件与独立 CLI。以 MaxCompute → StarRocks 为主线,也支持 Hive 和 Spark SQL 校验。
本版亮点
- 表契约随代码版本化。 记录业务键、分区、字段类型、币种与单位,以及质量阈值。破坏性变更需要记录迁移决定。
- 对账细到业务键。 使用十进制定点语义,支持单位换算和容差,定位汇总指标掩盖的差异。
- 验收结果可接入 CI。 报告区分通过、失败、未验证和不适用,证据绑定本次输入、环境和分区。
- SQL 规范贯穿开发和审查。
dw lint与 Claude Code Hooks 使用项目规则,执行前守卫覆盖可识别的 Bash 和 PowerShell 数据库调用。
从 v1 升级
插件命令带 dw-harness: 前缀,例如 /dw-harness:dw-etl。先用 dw init --dry-run 预览合并式迁移,升级后重新生成旧版验收证据。详见中文升级指南。
Quick start / 快速上手
CLI
python -m pip install "dw-harness==2.0.0"
dw --versionClaude Code — install the CLI above first / 先安装上面的 CLI
/plugin marketplace add pugyy/dw-harness
/plugin install dw-harness@dw-harness
/dw-harness:dw-bootstrap
Python 3.9+ · Claude Code 2.1.295+ · Support matrix / 支持矩阵
Try the offline demo / 离线演示 with python scripts/run_demo.py from a repository checkout.
Release verification / 发布验证
123 tests · 20/20 offline scenarios · 6/6 CI matrix jobs
123 个测试 · 20/20 离线场景 · 6/6 CI 矩阵任务
Live warehouse and authenticated Claude Code checks are tracked separately. See the verification guide.
真实数仓联调和登录态 Claude Code 验证仍待完成,复现步骤见验收文档。
dw doctor uses ! for non-critical notes and !! for a failure; only critical items affect the exit code.
dw doctor 的 ! 是非关键提示,!! 才是失败;退出码只看 critical 项。
Follow the project / 持续更新
Changelog / 完整变更 · Changes since v2.0.0 / 发布后的进展 · Issues / 反馈与建议
Trying this on a warehouse workflow? A minimal example with the SQL dialect, command, and expected result helps us reproduce it.
在实际数仓流程中遇到问题?欢迎附上 SQL 方言、执行命令和预期结果,脱敏后的最小样例就够用。
Assets and checksums / 资产与校验
The release assets are byte-identical to the files published on PyPI.
| File | Size | SHA-256 |
|---|---|---|
dw_harness-2.0.0-py3-none-any.whl |
193,185 B | 6139861457d799912874f025e98f0fc30f32ecd3c01a057701ccfca1610af90c |
dw_harness-2.0.0.tar.gz |
203,282 B | 51abfbbc0b295874cbd4b698de55c550a429a3a545ac09f705ef8413d09daa4b |
Release assets are the same files as PyPI. 发布资产与 PyPI 文件逐字节一致。