Skip to content

v0.3.4 Data Quality implementation and verification

This report records the initial same-provider milestone. The subsequently authorized PostgreSQL → MySQL extension and its 739-test regression are documented in cross-provider verification.

Unreleased implementation on feat/cdc-validation, based on f904ac3. Verification date: 2026-11-03. No commit, push, tag, deployment or publication is part of this work. Existing uncommitted v0.3.3 changes were inventoried before implementation and preserved; the baseline hashes are in .codex-tmp/dq-original-state.json.

A. Implementation

The feature adds four metadata entities and additive migration 0015, strict Pydantic configuration, six rule evaluators, live capability validation, safe read-only PostgreSQL/MySQL measurements, CRUD, manual Jobs, durable scheduling, immutable configuration snapshots, retained run/rule histories, RBAC and audit. It reuses encrypted Connections, database adapters, the existing Job lease/retry worker, AlertManager, incidents, notification deliveries and provider transports.

The frontend adds top-level navigation, a five-step editor (datasets, rules, schedule, alerting, review), capability validation, list filters/actions, check details/history/latest results and run details with measured evidence. All comparisons remain BEST_EFFORT. Existing CDC semantics are unchanged.

47 implementation/documentation files were added or changed; their complete paths and SHA-256 hashes are in artifacts/data-quality/implementation-files.json. All pre-existing v0.3.3 implementation-file hashes remain unchanged; previously dirty CHANGELOG/MkDocs files received additive documentation. Key files:

  • apps/api/migrations/versions/0015_data_quality.py, app/models/entities.py.
  • apps/api/app/schemas/data_quality.py, app/api/data_quality.py.
  • apps/api/app/services/data_quality*.py, app/workers/worker.py, app/core/auth.py.
  • apps/web/src/features/data-quality/, src/app/data-quality/, navigation/auth.
  • apps/api/tests/test_data_quality*.py, frontend unit and Playwright tests.
  • infrastructure/tests/data-quality.compose.yaml, scripts/data_quality_fixture.py, scripts/data_quality_migrations.py, .github/workflows/data-quality.yml.
  • Feature/operations/design/compatibility documentation, README, CHANGELOG and nav.

API prefix /api/v1/data-quality: GET/POST checks; GET/PATCH/DELETE checks/{id}; POST checks/{id}/run,pause,resume; GET checks/{id}/runs; GET runs/{id} and runs/{id}/results; POST validate; GET rules/catalog; GET connections/channels; GET connections/{id}/tables; POST columns. Every endpoint is permission-guarded.

B. Rule matrix

Rule Implemented options Deterministic tests PostgreSQL live MySQL live
row_count Full/window/filter, actual COUNT, BEST_EFFORT evidence PASS PASS PASS
row_count_diff Absolute/percentage/direction/nonnegative thresholds/zero Source PASS PASS PASS
last_updated Timestamp mapping/semantics/timezones/exact/tolerance/NULL PASS PASS PASS
freshness_delay Signed delay/ahead/future/idle/missing/activity window PASS PASS PASS
data_age Source-active gating/continuous arrival/SLA/NULL/unknown activity PASS PASS PASS
schema_match Canonical types/names/nullability/order/PK/mapping/exclusions PASS PASS PASS

The final Data Quality subset comprises 53 deterministic, 9 API/alert/session and 61 real-database tests, included in the full 704-test API suite. The real subset contains 48 rule scenario vectors plus 13 supporting assertions. These counts are overlapping coverage and are not summed as independent PASS totals. All rules block history/unverified pairs. Temporal ambiguity/unknown activity and unknown canonical types produce INCONCLUSIVE; lossy schema conversions fail.

C. E2E evidence and baseline

Baseline commands (before implementation):

Command Result
.venv/Scripts/python.exe -m pytest apps/api/tests -q --tb=short 577 passed, 4 skipped; 62.10 seconds
npm --workspace apps/web test -- --reporter=dot 23 files, 93 tests passed

Final production-image Data Quality Playwright command: DQ_BROWSER_TESTS=1 PLAYWRIGHT_BASE_URL=http://127.0.0.1:3015 npx playwright test tests/e2e/data-quality.spec.ts (working directory apps/web) passed three real-session workflows: Admin create/discover/multiple rules/10-minute schedule/channel/run/history/edit/pause/ resume, Viewer read-only, and Ops authorized editing/execution. Valid Viewer create/run API requests received 403. Measurements use SELECT-only database accounts. Screenshot: artifacts/data-quality/browser-admin.png.

python scripts/data_quality_migrations.py passed upgrade → downgrade to 0014 → upgrade to 0015, Alembic drift checks and unrelated table-count preservation and seeded unrelated row-hash preservation in the disposable dq_migration database. Evidence: artifacts/data-quality/migrations.json.

Live rule evidence records actual server versions, scenarios, expected/actual quality, execution status, run identity and consistency in artifacts/data-quality/live-results.jsonl. PostgreSQL and MySQL are independent Source/Destination containers: PostgreSQL 17.9 (Debian 17.9-1.pgdg13+1) on both sides, and MySQL 8.4.11 on both sides. Scenarios include PASS/FAIL, zero/empty/NULL, percentage thresholds, future/ahead timestamps, Source inactivity/unknown activity, missing columns and incompatible/extra schema columns. Additional tests exercise schema widening/unknown types, concurrent observations, parameterized filters/windows, read-only rejection, MAX/COUNT reuse, real PostgreSQL multi-worker claim and interrupted-lease recovery, actual scheduled execution, retention cleanup, timestamp precision differences, fixed half-open windows and measurement identity for a timestamp column named count. The final scenario records include safe persisted measurements, thresholds, observation times and durations. Repeated attempts in JSONL are not independent scenarios.

artifacts/data-quality/live-scenarios.json contains one final measured record per scenario (48 unique vectors). verification.json records machine-readable final counts without adding overlapping suites together.

D. Final regression results

Environment prefixes below use POSIX notation. PowerShell uses $env:NAME='value' before the command. Logs are retained under artifacts/data-quality/logs/.

Command Actual result
DQ_LIVE_TESTS=1 DQ_EVIDENCE_DIR=artifacts/data-quality WORKER_TEST_DATABASE_URL=postgresql+asyncpg://dq:dq-test-only@127.0.0.1:55435/dq .venv/Scripts/python.exe -m pytest apps/api/tests -q --tb=short --junitxml=artifacts/data-quality/api.xml 704 passed, 0 skipped, 106.00 s; api.xml
DQ_LIVE_TESTS=1 DQ_EVIDENCE_DIR=artifacts/data-quality .venv/Scripts/python.exe -m pytest apps/api/tests/test_data_quality_live.py -q --tb=short --junitxml=artifacts/data-quality/live.xml 61 passed, 28.44 s; overlapping evidence refresh, live.xml
npm run test:web 24 files, 96 tests passed, 11.41 s
Production Data Quality Playwright command above 3 passed, 21.5 s; logs/dq-browser-production.log
.venv/Scripts/python.exe -m ruff check apps/api scripts PASS
.venv/Scripts/python.exe -m ruff format --check apps/api scripts PASS, 229 files
.venv/Scripts/python.exe -m mypy --config-file apps/api/pyproject.toml apps/api/app PASS, 111 source files
npm run lint, npm run typecheck, npm run format:check PASS
.venv/Scripts/python.exe -m mkdocs build --strict PASS
.venv/Scripts/python.exe scripts/deployment_validation.py PASS, 11 rendered resources
docker build -f infrastructure/docker/api.Dockerfile -t cluecdc-dq-api:final . PASS, including Linux SQL Server native library loading
docker build -f Dockerfile -t cluecdc-dq-web:local . PASS, optimized production build
docker run --rm -v D:/cluecdc-open-source:/repo:ro -w /repo rhysd/actionlint:1.7.12 .github/workflows/data-quality.yml PASS
.venv/Scripts/python.exe scripts/data_quality_migrations.py PASS: upgrade/downgrade/re-upgrade/drift/seeded metadata row hashes; migrations.json

One unchanged pre-existing PytestWarning remains in test_extended_sources.py (empty regex match). No test was deleted or weakened. Exact expected Viewer permissions/navigation were extended for the approved feature; existing least-privilege prohibitions remain asserted.

All five existing CI Compose renderings and the new isolated fixture passed:

docker compose --env-file .env.example config --quiet
docker compose --env-file .env.example -f compose.yaml -f .github/compose.ci.yaml config --quiet
docker compose --env-file .env.example --env-file .env.test.example -f compose.yaml -f compose.test.yaml --profile tools config --quiet
docker compose --env-file .env.example --env-file .env.test.example -f compose.yaml -f compose.test.yaml -f .github/compose.ci.yaml -f .github/compose.test.ci.yaml --profile tools config --quiet
docker compose --env-file .env.example --env-file .env.test.example -f compose.yaml -f compose.test.yaml -f .github/compose.ci.yaml -f .github/compose.test.ci.yaml --profile object-storage config --quiet
docker compose -p cluecdc-dq-v034 -f infrastructure/tests/data-quality.compose.yaml config --quiet

Existing real CDC/browser acceptance commands all exited successfully:

.venv/Scripts/python.exe scripts/cdc_reliability.py --execute --chaos --api-image cluecdc-dq-api:local --connect-image cluecdc-connect:sources-test --minio-image cluecdc-ci-minio:ci --output artifacts/data-quality/cdc-reliability
.venv/Scripts/python.exe scripts/cdc_reliability.py --execute --pairs none --browser --api-image cluecdc-dq-api:local --web-image cluecdc-dq-web:local --connect-image cluecdc-connect:sources-test --minio-image cluecdc-ci-minio:ci --output artifacts/data-quality/cdc-browser
.venv/Scripts/python.exe scripts/cdc_reliability.py --execute --pairs none --snapshot-interruption --source-history-expiration --api-image cluecdc-dq-api:final --connect-image cluecdc-connect:sources-test --minio-image cluecdc-ci-minio:ci --output artifacts/data-quality/cdc-snapshot-wal
Scenario Expected Actual Status / evidence
Six PostgreSQL/MySQL → relational/MinIO/ClickHouse paths, CRUD/replay/outages/checkpoints Correct state/history semantics and safe recovery 82 acceptance records PASS PASS, cdc-reliability/summary.json and correctness/recovery/checkpoint files
Existing capture/JDBC/Effective Row Key demos Real delivery/key assertions Three wrapper scenarios PASS PASS, cdc-browser/capture-demo.json, jdbc-demo.json, effective-key.json
Existing Playwright suite Existing auth/connections/CDC/mobile/lifecycle paths pass 33 passed, 3 DQ tests deliberately skipped there PASS, cdc-browser/playwright.json; those DQ three passed in their own fixture
Interrupted PostgreSQL 50,000-row snapshot In-progress interruption; exact settled digest and streaming recovery Match; 50,001 rows verified PASS, cdc-snapshot-wal/recovery-tests.json
Lost-WAL diagnostics SOURCE_RECOVERY_REQUIRED; saved positions/config unchanged Match; no offset reset/slot deletion/resnapshot recovery PASS, same recovery file

Each CDC runner contains ten repeated NOT RUN compatibility rows for optional extended-source/cloud paths not selected. These are not failures or missing Data Quality gates and must not be summed across reports. Live MariaDB, SQL Server, MongoDB, Oracle and cloud-provider acceptance was NOT RUN here. Data Quality does not enable them. Native SQL Server driver packaging was checked by the actual Linux build, and its existing unit regressions passed.

Defects found/fixed: absent Windows IANA timezone data (pinned tzdata), MySQL metadata casing, unknown/idle Source activity handling, COUNT/MAX/schema key collisions, schema ordering with exclusions/additional Destination PK components, lost-lease publication and pending-incident cooldown. Production-build test typing and a browser navigation wait were corrected. Final checks pass.

E. Known limits

Only same-provider PostgreSQL/MySQL CURRENT_STATE tables are supported. Other providers, history/event-log/SCD data, arbitrary SQL, single-dataset checks, row-by-row reconciliation and repairs are unsupported. External table meaning requires explicit operator attestation; known history mappings are rejected. Naive timestamps require known timezones; ambiguous local times are inconclusive. Full scans can be expensive; timeouts do not guarantee a physical scan limit. Database concurrency is bounded per worker process, not by a distributed limiter. Discovery is limited to the registered database, 1,000 tables and 500 columns. Scope, period and predicates are shared by measured rules within a Check; Schema Match inspects current metadata independently. Hourly retention removes at most 1,000 expired runs per sweep; existing Job/audit retention is unchanged. Removed rules do not manufacture recovery for their previous incidents. No VERIFIED consistency or complete-CDC-correctness guarantee is offered.

F. Release review

GO for release review within the documented PostgreSQL/MySQL CURRENT_STATE scope. No blocking defect or unexecuted mandatory Data Quality gate remains. This is not production-wide CDC correctness certification or a published release. Follow-ups: explicit cross-provider verification, optional provider/version acceptance and deployment-specific capacity profiling before frequent full scans. See operations for reproducible fixture commands and compatibility for intentional capability gates.