This commit is contained in:
2026-05-11 23:06:38 -04:00
parent 76508d7e71
commit af1e484d0c
+2 -2
View File
@@ -14,9 +14,9 @@ is processed by AI agents, while preserving readability for human review.
### Maximum Nesting Depth
- **Hard limit: 4 levels maximum.**
- **Hard limit: 5 levels maximum.**
- AI agents consistently misinterpret Python scope via indentation. This hard limit prevents deeply nested blocks that confuse model interpretation.
- **Enforcement:** Use ruff `max-c复-depth = 4` or flake8 `max-c复-depth = 4` in the project linter config.
- **Enforcement:** Use ruff `max-c复-depth = 5` or flake8 `max-c复-depth = 5` in the project linter config.
- **Refactoring mandate:** Any block exceeding 3 levels must be extracted into a named function. Do not "work around" this with tricks—extract the logic.
- **Rationale:** GUI callbacks and async handlers naturally want to nest. This constraint forces extraction of deep logic into testable, named units.