# ========================================================== # SPRINT 2.6 # MODULE DEEP ANALYSIS # ========================================================== ## OBJECTIVE Perform a complete deep analysis of every ERP module. This sprint MUST analyze every discovered module one by one until 100% coverage is achieved. The objective is to build an Enterprise Knowledge Base that accurately reflects the implementation, business rules, dependencies, and business flows of every ERP module. Do not modify source code. Only analyze and generate documentation. ========================================================== LOAD CONTEXT ========================================================== Read: workflow_ai/discovery/ workflow_ai/knowledge/ workflow_ai/reports/ Read the complete ERP repository. ========================================================== PHASE 1 BUILD MODULE QUEUE ========================================================== Read all discovered modules. Generate workflow_ai/discovery/MODULE_QUEUE.md Each module shall contain - Module Name - Physical Location - Status - Priority - Complexity - Estimated Analysis Time Status TODO IN_PROGRESS COMPLETED ========================================================== PHASE 2 MODULE DEEP ANALYSIS ========================================================== Process ONE module at a time. For every module analyze Purpose Business Objective Menus Screens Controllers Models Services Repositories Libraries Routes Middleware Events Observers API Cron Jobs Reports Database Tables Database Relationships Permissions Configuration External Integrations Known Limitations Generate workflow_ai/knowledge/modules// ========================================================== PHASE 3 BUSINESS RULE EXTRACTION ========================================================== Extract all business rules. Examples Approval Rules Validation Rules Posting Rules Tax Rules Accounting Rules Inventory Rules Pricing Rules Discount Rules Generate BUSINESS_RULES.md ========================================================== PHASE 4 BUSINESS FLOW DISCOVERY ========================================================== Identify the business process implemented by the module. Build the sequence of operations from the source code. Example Customer ↓ Quotation ↓ Sales Order ↓ Delivery ↓ Invoice ↓ Payment ↓ Journal Generate BUSINESS_FLOW.md ========================================================== PHASE 5 DEPENDENCY ANALYSIS ========================================================== Identify Upstream Modules Downstream Modules Shared Tables Shared APIs Shared Services Generate DEPENDENCIES.md ========================================================== PHASE 6 DATABASE ANALYSIS ========================================================== Identify Tables Views Indexes Foreign Keys Triggers Stored Procedures Relationships Generate DATABASE.md ========================================================== PHASE 7 API ANALYSIS ========================================================== Identify REST APIs Internal APIs Service Calls External APIs Generate API.md ========================================================== PHASE 8 REPORT ANALYSIS ========================================================== Identify Reports Exports Imports Dashboards Generate REPORTS.md ========================================================== PHASE 9 CONFIDENCE ANALYSIS ========================================================== Assign confidence score. Example Business Rules 95% Business Flow 82% Dependencies 98% If confidence < 80% Generate review request under workflow_ai/review/ Example SALES_FLOW_REVIEW.md Include Question Evidence Alternative Interpretation Reason for Uncertainty ========================================================== PHASE 10 MODULE SUMMARY ========================================================== Generate README.md Containing Module Overview Business Purpose Key Features Dependencies Business Flow Summary Risk Areas Future Improvements ========================================================== PHASE 11 UPDATE ERP GRAPH ========================================================== Append discovered business flow into workflow_ai/knowledge/ERP_GRAPH.md Do not overwrite existing knowledge. ========================================================== PHASE 12 PROGRESS TRACKING ========================================================== Update workflow_ai/discovery/MODULE_QUEUE.md Mark completed module. Continue with the next module. Repeat until every module has been analyzed. ========================================================== OUTPUT STRUCTURE ========================================================== workflow_ai/ knowledge/ modules/ / README.md BUSINESS_RULES.md BUSINESS_FLOW.md DEPENDENCIES.md DATABASE.md API.md REPORTS.md KNOWN_LIMITATIONS.md workflow_ai/ knowledge/ ERP_GRAPH.md workflow_ai/ discovery/ MODULE_QUEUE.md workflow_ai/ review/ (optional) ========================================================== VALIDATION ========================================================== Verify Every discovered module has documentation. No module remains undocumented. Every module has README Business Rules Business Flow Dependencies Database API Reports ERP_GRAPH has been updated. ========================================================== STOP ========================================================== Stop only after every module has been analyzed. Generate workflow_ai/reports/MODULE_ANALYSIS_REPORT.md Containing Total Modules Completed Modules Pending Modules Coverage Percentage Review Requests Knowledge Base Statistics