Files
ctms/docs/plans/2026-03-30-remove-demo-study-seed-implementation.md
T
2026-03-31 11:20:57 +08:00

49 lines
1.4 KiB
Markdown

# Remove Demo Study Seed Implementation Plan
> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.
**Goal:** Stop development initialization from auto-creating any placeholder study or fee data.
**Architecture:** Remove the application startup hook that seeds placeholder fee data, while keeping schema setup and protected admin initialization intact. Add a regression test that proves the lifespan startup no longer calls the old seed helper.
**Tech Stack:** FastAPI, pytest, unittest.mock
---
### Task 1: Lock the startup behavior with a failing test
**Files:**
- Create: `backend/tests/test_app_startup.py`
- Modify: `backend/app/main.py`
**Step 1: Write the failing test**
```python
async def test_development_startup_does_not_seed_business_data():
...
```
**Step 2: Run test to verify it fails**
Run: `pytest backend/tests/test_app_startup.py -q`
Expected: FAIL because startup still calls the old seed helper.
**Step 3: Write minimal implementation**
Remove the obsolete seed hook from `backend/app/main.py`.
**Step 4: Run test to verify it passes**
Run: `pytest backend/tests/test_app_startup.py -q`
Expected: PASS.
### Task 2: Verify no regression in admin bootstrap
**Files:**
- Test: `backend/tests/test_protected_admin.py`
**Step 1: Run targeted regression tests**
Run: `pytest backend/tests/test_app_startup.py backend/tests/test_protected_admin.py -q`
Expected: PASS.