refactor: split aces_sdl.validator into a per-seam mixin package - #557
Merged
Conversation
- Convert validator.py (4,139 lines) into a package of <=600-line per-seam mixin modules (core, runtime families, relationships, content/objectives, workflows, sections) behind an API-stable SemanticValidator re-export (#42). - Pure refactor: methods moved verbatim; no validation behavior, diagnostics, pass ordering, exception type, or public-API change. The #38 cycle break (PR #53) is the satisfied ordering prerequisite. - Adapt the error-vs-advisory boundary lint (test_sdl_diagnostic_boundary) to scan the package and aggregate methods across the composed mixins; its rules and synthetic negative-path fixture are unchanged, so the IMP-3/#505 control keeps full teeth. Rationale recorded on the issue. - Remove validator.py from tools/policy/oversized_allowlist.yaml; repoint the F821 forward-ref per-file-ignore to validator/_sections.py. - Repoint stale validator.py references in the semantic-coverage matrix (-> validator/__init__.py) and specs/formal prose (-> package) to the new layout.
Behavior-preserving extraction across the validator mixin package to clear the new-code complexity violations (cognitive/cyclomatic/nesting/too-many-returns/too-many-params/make-static) SonarCloud raised on the verbatim-moved validators. No validation behavior, diagnostics, pass ordering, or public-API change; guarded by the existing test suite. Adds shared context dataclasses (_WorkflowBuildState, _CompensationState, _AvailableStateContext) and per-concern helpers; drops the now-unnecessary F821 per-file-ignore.
|
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Split the oversized
aces_sdl.validatormodule (4,139 lines, ~7x the ADR-015 600-line cap) into a package of per-validation-seam mixin modules, each under the cap, behind an API-stableSemanticValidatorre-export. Pure refactor: methods moved verbatim (git-detected moves), no validation behavior, diagnostics, pass ordering, exception type, or public-API change — the existing test suite is the regression contract. The #38 cycle break (PR #53) ordering prerequisite is satisfied. The error-vs-advisory boundary lint (test_sdl_diagnostic_boundary) is adapted to scan the package and aggregate methods across the composed mixins; its rules and synthetic negative test are unchanged so the IMP-3/#505 control keeps full teeth (the only test touched — engineering decision recorded on the issue). Removed from the oversized-source allowlist.Requirement UIDs
Related Issues
Closes #42
ADR Impact
Changes
validator.pyto avalidator/package:_core(validate() coordinator + shared ref/index/named-ref helpers),_nodes_infra_network,_runtime_services,_runtime_identity_data,_runtime_platform,_runtime_mail,_relationships,_content_objectives,_workflows_analysis,_workflows_verify,_sectionsmixins, plus_support(shared module-level helpers);__init__composesSemanticValidator(*mixins, _ValidatorCore)...for aces_sdl siblings; per-file imports trimmed by ruff.test_sdl_diagnostic_boundaryto read the package source and aggregate methods across all classes; the 5 boundary rules and the synthetic negative-path fixture are unchanged.validator.pyfromtools/policy/oversized_allowlist.yaml; repoint the F821 forward-reference per-file-ignore tovalidator/_sections.py.validator.pyreferences: the ADR-016 semantic-coverage matrix ->validator/__init__.py(compat-aware integration check passes); specs/formal prose -> package. CHANGELOG/ADR-015 historical references left intact.changelog.d/42.changed.md.Test Plan
make test)make integration)make checkpasses (Spotless, SpotBugs, Error Prone, Checkstyle, JaCoCo)Pure refactor — the existing test suite is the behavior contract.
nox -s verify -- --skip-requirementpasses: hygiene, policy (incl. ADR-015 size cap after de-allowlisting + ADR-016 semantic-coverage integration), ruff, full pytest (2,545 passed) + integration, and the Sphinx docs build. The adapted boundary lint passes on both the live package source and the synthetic negative fixture. No externalaces_sdl.validatorimport line changed (verified by diff); theaces.core.sdl.validatorcompat re-export still exposesSemanticValidator.Ground Control Checks
make policypassesgc_evaluate_quality_gatespasses or is unchanged by this repo-only changegc_run_sweepreviewed; findings fixed or recorded with rationaleTraceability
Checklist
docs/CODING_STANDARDS.md)@Auditedon new entities if applicablechangelog.d/42.changed.md