Skip to main content

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.

IDDescriptionImpactEst.Ref
FIN-01Sync-ify Payment Callbacks
Remove Task.Run in Payment controllers. Await processing.
Prevents Lost Revenue1dUntracked Fire-and-Forget
STAB-01Fix Async Deadlocks
Replace .Result with await in WepGoogleApiServiceFactory.
Prevents Server Lockup0.5dSync-over-Async
STAB-02Remove Sleep & Global Locks
Extract FollowUpComponentService logic.
Prevents Thread Starvation2dLoop of Death

🚧 DEFCON 2: Stability & Hygiene (Short Term)

Focus: Preventing resource exhaustion and "Ghost Bugs".

IDDescriptionImpactEst.VolumetricsRef
HYG-01Dispose Pattern
Wrap new WEPV2DataContext() in using.
Prevents Pool Exhaustion1d> 850Resource Leaks
HYG-02Reveal Silent Failures
Add logging to empty catch.
Enables Debugging1d> 20Swallowed Exceptions
HYG-02Reveal Silent Failures
Add logging to empty catch.
Enables Debugging1d> 20Swallowed Exceptions

🚀 DEFCON 3: Performance Optimization (Medium Term)

Focus: Reducing latency and DB load.

IDDescriptionImpactEst.VolumetricsRef
PERF-01"ToList" Purge
Remove .ToList().Where(...).
Massive DB Load Reduction2d~30Client-Side Eval, OMGT Plan
PERF-02Session Audit
Mark read-dependent Controllers as ReadOnly.
Unlocks Parallel Request1dHigh UsageSession Locking
PERF-03String Optimization
Use StringBuilder in TravelInfoOMGT.
Condition: Only if Hot Path
Reduces GC Pressure0.5d> 2,000Defense: Ignore unless Hot
PERF-04Stop Leaky Abstractions
Materialize IQueryable in Services.
Prevents N+13d~43 MethodsLeaky Abstraction
PERF-05Fix Mass Action
Use StringBuilder & Eager Load in Template.
Fixes GC & N+11dCriticalLoop of Death, OMGT Plan
PERF-06Formalize Skills
Performance Stabilization & Async Hygiene protocols.
Knowledge Reusability0.5dCorePerformance Stabilization Skill
STAB-04Selective Async
Convert non-critical Email/HTTP calls to async.
Note: Keep UX-critical calls sync.
Prevents Thread Starvation1dHighDefense: Tolerate UX
REFACT-01Split Importer
Refactor FinancialTransactionImporter.
Prevents Timeouts3d1 Major CompGod Method

🐘 DEFCON 4: The "Elephant in the Room" (Long Term)

Focus: Making the codebase manageable again.

IDDescriptionStrategyRef
ARCH-01Deconstruct God Entities
OrderTravelProductOMGT (5k LOC).
Extract Class: Stop adding logic.God Entity
ARCH-02Segregate Interfaces
WepKeyNoteModelNGFactory (3.5k LOC).
Split into smaller Factories.God Service
ARCH-03Deconstruct Monolithic BFF
Split FrontApiBiz (71 files).
Split by Feature (/Checkout).God Namespace
HYG-03Externalize Paths
Move C:\Temp and hardcoded paths.
Moves here per Defense: Keep (Low Risk).Hardcoded Paths
STAB-03Exorcise Embedded BI
Move WAYTDFeeder logic to DB/Zoho.
Moves here per Defense: Tolerate (Tactical).Embedded BI

📅 Release Strategy

  1. Hotfix v1.1.0 (Day 1-2): FIN-01, STAB-01. (Deploy immediately).
  2. Stability Release v1.2.0 (Week 1): STAB-02, HYG-01, HYG-02.
  3. Performance Release v1.3.0 (Week 2): PERF-01, PERF-03, STAB-03 (Exorcise BI).
  4. Refactoring Release v1.4.0 (Week 3): PERF-04 (Leaky Abs), HYG-03 (Paths), REFACT-01 (Importer).
  5. Architectural Pivot v1.5.0 (Month 2): ARCH-03 (BFF Split), STAB-04 (Async Email).