Quality Gates & Make Contract
Relevant source files
The following files were used as context for generating this wiki page:
Quality Gates and the Make Contract represent the enforcement mechanisms for project integrity, data accuracy, and engineering standards within the flext-dbt-oracle-wms repository. These systems ensure that all changes meet the "Zero-Debt Baseline" before merging and that data transformations adhere to strict business rules and referential integrity.
The "Make Contract" serves as the canonical command surface for all operations, including linting, testing, and validation, while "Quality Gates" define the specific thresholds and selectors (such as coverage and lint rules) that must be satisfied. These gates apply to both the Python orchestration layer and the DBT transformation logic.
Sources: README.md:37-39, AGENTS.md:143-150, AGENTS.md:16-24
The Make Contract
The project utilizes a standardized make dispatch surface that acts as the sole authority for execution. All build, check, and validation actions must run through these canonical verbs rather than direct tool invocations.
Canonical Make Verbs
| Verb | Purpose | Relevant Tooling |
|---|---|---|
check | Static analysis and linting | Ruff, Pyright, Mypy, Codespell |
test | Unit and integration testing | Pytest, Pytest-cov |
val | Runtime validation and data quality | DBT tests, Great Expectations (implied) |
docs | Documentation generation | MkDocs |
mod | Project standardization | flext_infra.deps.modernizer |
Sources: README.md:37-39, AGENTS.md:143-150, pyproject.toml:1-5
Execution Logic
The following diagram illustrates how the Make Contract enforces the "Continuous Green" policy before any code can be considered "Done."
Sources: AGENTS.md:43-52, AGENTS.md:143-150
Quality Gates: Python Layer
The Python layer enforces strict static analysis and coverage thresholds defined in pyproject.toml.
Static Analysis Configuration
The project mandates a "Strict-Total" approach where no suppressions (e.g., # type: ignore) are allowed without documented justification.
- Type Checking: Managed via
mypyandpyrightin "strict" mode. - Linting: Controlled by
ruffwithALLrules selected by default. - Coverage: The
tool.coverage.reportdefines afail_underthreshold of 20% (as a baseline for this specific module) with high precision requirements.
Sources: pyproject.toml:120-140, pyproject.toml:250-265, AGENTS.md:195-200
Governance and Skill Selection
Quality gates are specifically guided by the flext-quality-gates skill, which provides the selectors and thresholds for different execution environments.
Sources: README.md:37-39, AGENTS.md:14-16
Quality Gates: DBT & Data Layer
In the DBT transformation layer, quality gates are implemented through schema tests, business rule validations, and cross-model consistency checks.
Data Quality Tiers
The system defines specific thresholds for data health in dbt_project.yml:
| Metric | Threshold | File Source |
|---|---|---|
| Completeness | 0.95 | dbt_project.yml:105 |
| Accuracy | 0.98 | dbt_project.yml:106 |
| Consistency | 0.90 | dbt_project.yml:107 |
Sources: dbt_project.yml:104-107
Validation Workflow
Data quality is enforced during extraction and transformation via the FlextDbtOracleWmsClient.
Cross-Model Consistency Tests
Automated SQL tests ensure referential integrity across the 5-layer architecture (Staging, Marts, etc.). Examples include:
- Orphaned Allocations: Ensuring all allocations reference valid orders.
- Over-Allocation: Validating that allocated quantity does not exceed available inventory.
- KPI Mismatches: Ensuring dashboard totals align with operational summaries.
Sources: tests/data_quality/test_cross_model_consistency.sql:1-60
Project Governance Principles
The Quality Gates are underpinned by the Universal Agent Law, which mandates:
- Zero-Tolerance: No
TODOs, stubs, or "temporary" workarounds are allowed to pass gates. - Continuous Green: No completion if the project or environment is broken or partially migrated.
- One Active Intent: Preservation of the required gates through delegation.
Sources: AGENTS.md:185-195, AGENTS.md:43-45
Conclusion
Quality Gates & the Make Contract ensure that flext-dbt-oracle-wms maintains enterprise-grade reliability. By routing every operation through canonical make verbs and enforcing strict data quality thresholds in DBT, the project guarantees that only validated, high-integrity data moves from Oracle WMS into the analytical marts.