feat: add prominent startup warning for DEV mode

Add comprehensive warning display when server starts in development mode
to ensure users are aware of simulated AI calls and data handling.

Changes:
- Add log_dev_mode_startup_warning() function in deployment_config.py
- Display warning on main.py startup when DEPLOYMENT_MODE=DEV
- Display warning on API server startup (api/main.py)
- Warning shows AI simulation status and data persistence behavior
- Provides clear instructions for switching to PROD mode

The warning is highly visible and informs users that:
- AI API calls are simulated (no costs incurred)
- Data may be reset between runs (based on PRESERVE_DEV_DATA)
- System is using isolated dev database and paths

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-01 12:57:54 -04:00
parent d656dac1d0
commit b9353e34e5
3 changed files with 45 additions and 6 deletions

View File

@@ -23,7 +23,7 @@ from api.simulation_worker import SimulationWorker
from api.database import get_db_connection
from api.price_data_manager import PriceDataManager
from api.date_utils import validate_date_range, expand_date_range, get_max_simulation_days
from tools.deployment_config import get_deployment_mode_dict
from tools.deployment_config import get_deployment_mode_dict, log_dev_mode_startup_warning
import threading
import time
@@ -506,4 +506,8 @@ app = create_app()
if __name__ == "__main__":
import uvicorn
# Display DEV mode warning if applicable
log_dev_mode_startup_warning()
uvicorn.run(app, host="0.0.0.0", port=8080)