feat(audit): add mirror_audit.py AST-based cyclomatic complexity checker#441
Open
borjamoskv wants to merge 1 commit into
Open
feat(audit): add mirror_audit.py AST-based cyclomatic complexity checker#441borjamoskv wants to merge 1 commit into
borjamoskv wants to merge 1 commit into
Conversation
Adds cortex/audit/mirror_audit.py — a standalone AST-based tool that enforces cyclomatic complexity limits across cortex/ modules. - McCabe complexity computed via ast.walk (If/For/While/ExceptHandler/BoolOp etc.) - Parametric threshold (default: 10); CLI --threshold override - File discovery skips __pycache__, .venv, cli/, tests/, benchmarks/ - Returns AuditReport dataclass with scanned count + violations list - CLI entry point: python -m cortex.audit.mirror_audit - Exempt dirs align with test_no_bare_print.py policy Part of the Mirror Audit initiative to enforce architectural simplicity in agent-facing modules. Closes #395
Contributor
∞ MÖBIUS — PR Analysis
Labels applied: Warning No test files detected in this PR. Consider adding tests. Generated by MÖBIUS (Clojure/Babashka) — where code IS data |
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.
Adds cortex/audit/mirror_audit.py — a standalone AST-based tool that enforces cyclomatic complexity limits across cortex/ modules.
Part of the Mirror Audit initiative to enforce architectural simplicity in agent-facing modules. Closes #395
▀▄ CORTEX-PERSIST PULL REQUEST
█ EPISTEMIC HUMILITY CHECKLIST
All generative AI code is treated as conjecture until deterministic validation is proven. You MUST check all boxes before this PR can be merged.
persistencedo not break existing SHA-256 Merkle chain validation.#0A0A0A(Black),#2B3BE5(Blue), and Humanist Sans brutalist aesthetic.█ ARCHITECTURAL IMPACT
(Provide a concise explanation of the causal effect of this PR. Zero decorative prose. Every sentence must change behavior.)
Context:
Changes:
Telemetry / Performance Delta (if any):
█ VERIFICATION EVIDENCE
(Paste relevant CLI output, test success logs, or C5-REAL cryptographic proofs demonstrating the change functions as claimed)
# Paste verification logs here