Quality Models & Typings
Relevant source files
The following files were used as context for generating this wiki page:
Quality Models & Typings define the structured data contracts for the flext-quality orchestration platform. These components provide a unified schema for documentation audits, style enforcement, and link validation using Pydantic-2 models.
The system organizes domain models into a split architecture across multiple parts to maintain manageable module sizes. The public facade FlextQualityModels composes these parts through Method Resolution Order (MRO). This structure ensures that quality checks, maintenance schedules, and execution results follow a strictly typed interface.
Sources: src/flext_quality/_models/flextqualitymodels_part_01.py:1-15, src/flext_quality/_models/flextqualitymodels_part_02.py:1-15, src/flext_quality/__init__.py:80-100
Model Architecture and Composition
The quality domain models extend the FlextWebModels base classes. The hierarchy enables managed field validation and strict typing for all quality-related data structures.
The diagram shows the inheritance chain where Part 02 extends the functionality of Part 01 to provide advanced features like maintenance scheduling.
Sources: src/flext_quality/_models/flextqualitymodels_part_01.py:18-20, src/flext_quality/_models/flextqualitymodels_part_02.py:27-30
Core Quality Metrics and Auditing
The Quality.AuditMetrics and Quality.Issue models track documentation health. These models capture findings from analysis runs and organize them by severity and type.
Audit Result Structures
| Model | Field | Type | Description |
|---|---|---|---|
AuditMetrics | total_issues | int | Total documentation issues found. |
AuditMetrics | quality_score | int | Score from 0 to 100. |
Issue | severity | str | critical, high, medium, or low. |
Issue | recommendation | str | Suggested fix for the issue. |
ValidationResult | valid_items | int | Count of items passing validation. |
Sources: src/flext_quality/_models/flextqualitymodels_part_01.py:28-55, src/flext_quality/_models/flextqualitymodels_part_01.py:289-325
Style and Content Validation
Configuration models define the rules for Markdown style, accessibility, and content depth. The Quality.MarkdownStyleConfig and Quality.AccessibilityConfig models enforce structural consistency.
Validation Configuration Data Flow
The flow demonstrates how validation settings lead to aggregated style findings and summary counts.
Sources: src/flext_quality/_models/flextqualitymodels_part_01.py:91-200, src/flext_quality/_models/flextqualitymodels_part_01.py:228-265
Link and Content Analysis
The system provides specialized models for validating external and internal links. LinkCheckResult tracks HTTP status codes and response times, while ContentMetrics analyzes readability and structure.
- Link Performance:
LinkPerformanceMetricstracksaverage_response_timeandslowest_response. - Content Issues:
ContentIssueidentifies specific failures in file content, includingreadability_scoreandword_countviolations. - Link Records:
LinkRecordstores the visible text and target URL for every link found in documentation.
Sources: src/flext_quality/_models/flextqualitymodels_part_02.py:302-385, src/flext_quality/_models/flextqualitymodels_part_02.py:440-465
Maintenance and Task Execution
The platform manages scheduled maintenance through MaintenanceConfig. This includes task definitions, schedules, and error handling policies for automated documentation updates.
This diagram illustrates the relationship between maintenance configurations and the tasks they execute.
Sources: src/flext_quality/_models/flextqualitymodels_part_02.py:33-140
Constants and Typings
The system uses pre-compiled regex patterns to identify forbidden code patterns and quality violations. These are stored in FlextQualityConstantsValues.
- Type Management: The
u.Qualityutility namespace providesRELAXED_CONTAINER_MAPPING_ADAPTERand other TypeAdapters for safe JSON handling. - Regex Authorities:
FORBIDDEN_PATTERN_RE_MAPincludes patterns fortype-ignore,cast-usage, andAnytype annotations. - Timeouts: Standard timeouts include
HOOK_TIMEOUT_MS(5000ms) andMCP_TIMEOUT_MS(30000ms).
Sources: src/flext_quality/utilities.py:27-45, src/flext_quality/_constants/values.py:116-141, src/flext_quality/_constants/values.py:40-45
Conclusion
Quality Models & Typings form the structural foundation of the flext-quality ecosystem. By centralizing validation rules, execution requests, and audit metrics into strictly typed Pydantic models, the project ensures consistent quality analysis across diverse toolsets. These models enable the platform to provide detailed recommendations and automated maintenance while adhering to enterprise documentation standards.