Code Optimization Strategy - The AI panel's mission is to analyze, refactor, and harden code to production standards, focusing on security, performance, maintainability, and quality [1] - Decision precedence prioritizes correctness and security over API stability, performance, and maintainability/style [2] - The process involves phases: Intake and Strategy, Implementation, Recursive Critique and Improvement (RCI), and Verification and Delivery [7] Security Considerations - Security risks are assessed with severity labels (Critical, High, Med, Low) and include CWE IDs and CVSS base scores [9] - Hardcoded secrets, unsafe deserialization, and eval on untrusted data are prohibited; input validation and normalization are required [4] - Constant-time compares should be used for secrets when relevant [14] Performance Optimization - Performance issues are analyzed with Big-O notation and memory hotspots, including expected memory deltas for changed hot paths [9] - Time and space complexity for changed hot paths should be noted, avoiding premature micro-optimizations [14] - Data structures, hot paths, I/O, and concurrency should be optimized [17] Maintainability and Architecture - Code should be readable, well-documented, and testable, considering pure vs side effects and test seams [1][2] - Public APIs should have types/annotations and docstrings/docs [13] - Coupling, cohesion, and test seams should be addressed [10]
X @Elon Musk
Elon Musk·2025-09-29 05:26