WEP NG - Performance & Stabilization Master Plan
[!IMPORTANT] This "Master Plan" consolidates all critical findings from the January 2026 Audit. It supersedes previous partial roadmaps. The goal is to stabilize the platform's core mechanics (Financial Integrity, Stability, Performance) without rewriting the business logic.
🚨 DEFCON 1: Critical Integrity & Uptime (Immediate)
Focus: Preventing lost money and server deadlocks.
| ID | Description | Impact | Est. | Ref |
|---|---|---|---|---|
| FIN-01 | Sync-ify Payment Callbacks Remove Task.Run in Payment controllers. Await processing. | Prevents Lost Revenue | 1d | Untracked Fire-and-Forget |
| STAB-01 | Fix Async Deadlocks Replace .Result with await in WepGoogleApiServiceFactory. | Prevents Server Lockup | 0.5d | Sync-over-Async |
| STAB-02 | Remove Sleep & Global Locks Extract FollowUpComponentService logic. | Prevents Thread Starvation | 2d | Loop of Death |
🚧 DEFCON 2: Stability & Hygiene (Short Term)
Focus: Preventing resource exhaustion and "Ghost Bugs".
| ID | Description | Impact | Est. | Volumetrics | Ref |
|---|---|---|---|---|---|
| HYG-01 | Dispose Pattern Wrap new WEPV2DataContext() in using. | Prevents Pool Exhaustion | 1d | > 850 | Resource Leaks |
| HYG-02 | Reveal Silent Failures Add logging to empty catch. | Enables Debugging | 1d | > 20 | Swallowed Exceptions |
| HYG-02 | Reveal Silent Failures Add logging to empty catch. | Enables Debugging | 1d | > 20 | Swallowed Exceptions |
🚀 DEFCON 3: Performance Optimization (Medium Term)
Focus: Reducing latency and DB load.
| ID | Description | Impact | Est. | Volumetrics | Ref |
|---|---|---|---|---|---|
| PERF-01 | "ToList" Purge Remove .ToList().Where(...). | Massive DB Load Reduction | 2d | ~30 | Client-Side Eval, OMGT Plan |
| PERF-02 | Session Audit Mark read-dependent Controllers as ReadOnly. | Unlocks Parallel Request | 1d | High Usage | Session Locking |
| PERF-03 | String Optimization Use StringBuilder in TravelInfoOMGT. Condition: Only if Hot Path | Reduces GC Pressure | 0.5d | > 2,000 | Defense: Ignore unless Hot |
| PERF-04 | Stop Leaky Abstractions Materialize IQueryable in Services. | Prevents N+1 | 3d | ~43 Methods | Leaky Abstraction |
| PERF-05 | Fix Mass Action Use StringBuilder & Eager Load in Template. | Fixes GC & N+1 | 1d | Critical | Loop of Death, OMGT Plan |
| PERF-06 | Formalize Skills Performance Stabilization & Async Hygiene protocols. | Knowledge Reusability | 0.5d | Core | Performance Stabilization Skill |
| STAB-04 | Selective Async Convert non-critical Email/HTTP calls to async. Note: Keep UX-critical calls sync. | Prevents Thread Starvation | 1d | High | Defense: Tolerate UX |
| REFACT-01 | Split Importer Refactor FinancialTransactionImporter. | Prevents Timeouts | 3d | 1 Major Comp | God Method |
🐘 DEFCON 4: The "Elephant in the Room" (Long Term)
Focus: Making the codebase manageable again.
| ID | Description | Strategy | Ref |
|---|---|---|---|
| ARCH-01 | Deconstruct God Entities OrderTravelProductOMGT (5k LOC). | Extract Class: Stop adding logic. | God Entity |
| ARCH-02 | Segregate Interfaces WepKeyNoteModelNGFactory (3.5k LOC). | Split into smaller Factories. | God Service |
| ARCH-03 | Deconstruct Monolithic BFF Split FrontApiBiz (71 files). | Split by Feature (/Checkout). | God Namespace |
| HYG-03 | Externalize Paths Move C:\Temp and hardcoded paths. | Moves here per Defense: Keep (Low Risk). | Hardcoded Paths |
| STAB-03 | Exorcise Embedded BI Move WAYTDFeeder logic to DB/Zoho. | Moves here per Defense: Tolerate (Tactical). | Embedded BI |
📅 Release Strategy
- Hotfix v1.1.0 (Day 1-2): FIN-01, STAB-01. (Deploy immediately).
- Stability Release v1.2.0 (Week 1): STAB-02, HYG-01, HYG-02.
- Performance Release v1.3.0 (Week 2): PERF-01, PERF-03, STAB-03 (Exorcise BI).
- Refactoring Release v1.4.0 (Week 3): PERF-04 (Leaky Abs), HYG-03 (Paths), REFACT-01 (Importer).
- Architectural Pivot v1.5.0 (Month 2): ARCH-03 (BFF Split), STAB-04 (Async Email).