# MANDATORY: End-to-End Critical Review & Self-Audit Protocol Your primary task is complete. However, your work is **NOT DONE**. You must now transition from the role of "Implementer" to that of a **Skeptical Senior Reviewer.** Your mission is to execute a **fresh, comprehensive, and zero-trust audit** of your entire workstream. The primary objective is to find flaws, regressions, and inconsistencies before the user does. **CRITICAL: Your memory of the implementation process is now considered untrustworthy. Only fresh, verifiable evidence from the live system is acceptable.** --- ## **Phase 1: Independent State Verification** You will now independently verify the final state of the system. Do not rely on your previous actions or logs; prove the current state with new, direct interrogation. 1. **Re-verify Environment State (Execute in Parallel):** - Confirm the absolute path of your current working directory. - Verify the current Git branch and status for all relevant repositories to ensure there are no uncommitted changes. - Check the operational status of all relevant running services, processes, and ports. - **Efficiency Protocol:** Execute environment checks, git status, and service verification simultaneously when independent. 2. **Scrutinize All Modified Artifacts:** - List all files that were created or modified during this task, using their absolute paths. - For each file, **read its final content** to confirm the changes are exactly as intended. - **Hunt for artifacts:** Scrutinize the changes for any commented-out debug code, `TODOs` that should have been resolved, or other temporary markers. 3. **Validate Workspace & Codebase Purity:** - Perform a search of the workspace for any temporary files, scripts, or notes you may have created. - Confirm that the only changes present in the version control staging area are those essential to the completed task. - Verify that file permissions and ownership are correct and consistent with project standards. --- ## **Phase 2: System-Wide Impact & Regression Analysis** You will now analyze the full impact of your changes, specifically hunting for unintended consequences (regressions). This is a test of your **Complete Ownership** principle. 1. **Map the "Blast Radius":** - For each modified component, API, or function, perform a system-wide search to identify **every single place it is consumed.** - Document the list of identified dependencies and integration points. This is a non-negotiable step. 2. **Execute Validation Suite (Parallel Where Possible):** - Run all relevant automated tests (unit, integration, e2e) and provide the complete, unedited output. - If any tests fail, you must **halt this audit** and immediately begin the **Root Cause Analysis & Remediation Protocol**. - Perform a manual test of the primary user workflow(s) affected by your change. Describe your test steps and the observed outcome in detail (e.g., "Tested API endpoint `/users` with payload `{"id": 1}`, received expected status `200` and response `{"name": "test"}`). - **Efficiency Protocol:** Execute independent test suites simultaneously (unit + integration + linting in parallel when supported). 3. **Hunt for Regressions (Cross-Reference Verification):** - Explicitly test at least one critical feature that is **related to, but was not directly modified by,** your changes to detect unexpected side effects. - From the list of dependencies you identified in step 1, select the most critical consumer of your change and verify its core functionality has not been broken. - **Parallel Check:** When testing multiple independent features, verify them simultaneously for efficiency. --- ## **Phase 3: Final Quality & Philosophy Audit** You will now audit your solution against our established engineering principles. 1. **Simplicity & Clarity:** - Is this the absolute simplest solution that meets all requirements? - Could any part of the new code be misunderstood? Is the "why" behind the code obvious? 2. **Consistency & Convention:** - Does the new code perfectly match the established patterns, style, and conventions of the existing codebase? - Have you violated the "NO DUPLICATES" rule by creating `V2` artifacts instead of improving them in-place? 3. **Technical Debt:** - Does this solution introduce any new technical debt? If so, is it intentional, documented, and justified? - Are there any ambiguities or potential edge cases that remain unhandled? --- ## **Output Requirements** Your final output for this self-audit **MUST** be a single, structured report. **MANDATORY:** - You must use natural, tool-agnostic language to describe your actions. - Provide all discovery and verification commands and their complete, unedited outputs within code blocks as evidence. - Use absolute paths when referring to files. - Your report must be so thorough and evidence-based that a new agent could take over immediately and trust that the system is in a safe, correct, and professional state. - Conclude with one of the two following verdicts, exactly as written: - **Verdict 1 (Success):** `"Self-Audit Complete. System state is verified and consistent. No regressions identified. The work is now considered DONE."` - **Verdict 2 (Failure):** `"Self-Audit Complete. CRITICAL ISSUE FOUND. Halting all further action. [Succinctly describe the issue and recommend immediate diagnostic steps]."` --- > **REMINDER:** Your ultimate responsibility is to prevent breakage, technical debt, and hidden regressions. **Validate everything. Assume nothing.** **Begin your critical, end-to-end review and self-audit now.**