Repository navigation
Complexity + god-folder ratchet gates (pattern 07, gates II) - #27
Merged
Merged
Conversation
Implements the complexity half of docs/patterns/07: - scripts/check-complexity.sh (warn-only view + --gate / --update-baseline) + radon_warn.py + complexity_gate.py (file-level worst-cc ratchet vs .complexity-baseline, may only shrink). - radon added as a backend dev-dependency; the script resolves it from the backend Poetry venv (deterministic in CI), falling back to PATH / python3 -m radon / a bootstrap .radon-venv (gitignored). - .complexity-baseline seeded from the 4 current cc>20 offenders in backend/app; gate verified exit 0. - make check-complexity / check-complexity-gate / check-complexity-gate-update. The TypeScript/eslint half degrades gracefully and stays inactive until an ESLint flat config (eslint.config.js) exists - a separate pre-existing gap. Additive tooling; backend tests stay green (1281 passed). Closes #26
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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.
Closes #26
Closes #28
Completes the remaining ratchet gates of docs/patterns/07 (the cohesion/file-size gate already shipped in #23). Additive tooling.
Complexity ratchet (Python/radon)
scripts/check-complexity.sh(warn-only view +--gate+--update-baseline) +radon_warn.py+complexity_gate.py— file-level worst-cc ratchet vs.complexity-baseline(may only shrink).radonadded as a backend dev-dependency; resolved from the backend Poetry venv (deterministic in CI), with fallbacks..complexity-baselineseeded from the 4 real cc>20 offenders inbackend/app(genuine, not hollow).God-folder watcher
scripts/check-directory-size.sh— warns when a directory underfrontend/srcholds >15 flat*.ts/*.tsxfiles,--gateratchet vs.dirsize-baseline(seeded:components/58 = EXAMPLE-DOMAIN,hooks/16).Targets
make check-complexity/check-complexity-gate/check-complexity-gate-update/check-directory-size/check-directory-size-gate.The TypeScript/eslint half of the complexity gate degrades gracefully and stays inactive until the template has an ESLint flat config (
eslint.config.js) — the one remaining pattern-07 gap.Verified
make check-complexity-gate→ exit 0 (4 baselined, radon actually runs).make check-directory-size-gate→ exit 0 (2 baselined).make test-backend→ 1281 passed.