Quality Gates & Compliance
Relevant source files
The following files were used as context for generating this wiki page:
Quality Gates and Compliance within the flext-target-ldif project represent a rigorous framework of engineering standards, automated checks, and validation logic designed to ensure high-fidelity LDAP Data Interchange Format (LDIF) output and Singer protocol adherence. This system encompasses both the "Universal Agent Law" for development conduct and technical implementation layers that enforce data integrity.
The framework ensures that all contributions and operations meet strict technical requirements, from code quality and dependency management to the structural validation of LDAP entries and target configurations.
Sources: AGENTS.md:14-25, README.md:46-51, src/flext_target_ldif/models.py:84-125
Engineering Conduct & Universal Agent Law
The project operates under a "Zero-Tolerance / Strict-Total" engineering conduct policy. This "Universal Agent Law" binds all developers and AI agents to absolute standards of technical debt prevention and root-cause resolution.
Core Principles
- Zero-Tolerance: Every failure surfaced during a task must be fixed; workarounds, stubs, and legacy classification for current failures are forbidden.
- Fix-Forward-Only: Reverting shared work is prohibited to prevent destruction of in-flight changes in a multi-agent environment.
- Strict Typing: The project mandates the most restrictive types that compile, prohibiting
Anyor unchecked casts without explicit documentation. - SSOT (Single Source of Truth): Authoritative sources for facts must be referenced, never duplicated.
Sources: AGENTS.md:17-48, AGENTS.md:73-76
Automated Quality Gates
The project utilizes a make contract to execute standardized quality checks. These gates serve as the final barrier before code is considered "Done."
| Verb | Description | Context |
|---|---|---|
check | Static analysis and linting (Ruff, Mypy, Codespell) | Development/CI |
test | Unit and integration test execution | Validation |
val | Extended validation and compliance checks | Compliance |
docs | Documentation generation and consistency checks | Documentation |
Sources: README.md:46-51, pyproject.toml:92-140
Static Analysis Configuration
The pyproject.toml defines strict thresholds and configurations for the quality tools:
- Mypy: Configured with
strict_equality = true,warn_unreachable = true, andcheck_untyped_defs = true. - Coverage: A minimum threshold is enforced (set at 20% for this specific module, but with precision and missing line reporting).
- Ruff: Comprehensive linting using the
ALLselector, with specific ignores documented to manage standard library or protocol-specific edge cases.
Sources: pyproject.toml:144-150, pyproject.toml:171-193, pyproject.toml:351-404
Data Validation & Business Rules
Compliance is enforced programmatically through validation logic in the data models. The FlextTargetLdifModels class defines business rules for LDAP entries and target configurations.
LDIF Entry Validation
LDAP entries are validated against structural requirements before being processed by the writer.
The validation logic ensures that every LdifEntry contains necessary LDAP components like Distinguished Names (DN) and Object Classes.
Sources: src/flext_target_ldif/models.py:84-125
Configuration Compliance
The FlextTargetLdif target class implements validate_config() to ensure the Singer target is initialized with valid parameters.
| Parameter | Validation Rule | Source |
|---|---|---|
output_file | Must not be empty; required for writer | test_target.py |
dn_template | Must contain valid placeholder fields for DN generation | test_target.py |
line_length | Must be a positive integer (standard 78) | models.py |
output_path | Target ensures directory exists (creates if missing) | target.py |
Sources: src/flext_target_ldif/target.py:59-83, tests/unit/test_target.py:82-105
Testing Infrastructure
The test suite acts as a quality gate by simulating end-to-end LDIF generation and verifying compliance with both LDIF standards and Singer SDK patterns.
The sequence diagram illustrates how the testing suite validates the flow from configuration to filesystem output, ensuring no invalid data bypasses the internal gates.
Sources: tests/unit/test_target.py:228-251, src/flext_target_ldif/models.py:230-244
Conclusion
Quality Gates & Compliance in flext-target-ldif are not merely external checks but are deeply integrated into the codebase via Pydantic-based settings validation, strict Mypy/Ruff configurations in pyproject.toml, and the implementation of business rule validation within the domain models. This multi-layered approach ensures that the LDIF output is valid for LDAP systems and that the code adheres to the FLEXT ecosystem's strict engineering laws.
Sources: pyproject.toml:1-10, AGENTS.md:14-16, src/flext_target_ldif/models.py:46-55