release(main): 清理示例数据并统一空态体验

This commit is contained in:
Cheng Zhou
2026-03-31 11:21:27 +08:00
parent ec142498f4
commit 546c0e04c9
38 changed files with 786 additions and 729 deletions
@@ -10,7 +10,7 @@ Reviewer: `Codex`
- [x] Finance pages visual consistency
- [x] File/admin detail visual consistency
- [x] Desktop and iPad width checks
- [x] Management demo path continuity
- [x] Management path continuity
Notes:
- Verified unified contract classes and shared shell usage on all target pages.
+1 -1
View File
@@ -86,7 +86,7 @@
},
"published_data": null,
"published_project_snapshot": {
"code": "DEMO-CTMS",
"code": "CTMS-001",
"name": "演示项目",
"project_full_name": "演示项目全称",
"sponsor": "",
@@ -423,7 +423,7 @@ Create acceptance checklist with explicit pass/fail items. Mark all as pending i
- [ ] Finance pages visual consistency
- [ ] File/admin detail visual consistency
- [ ] Desktop and iPad width checks
- [ ] Management demo path continuity
- [ ] Management path continuity
```
**Step 2: Run test to verify it fails**
@@ -451,10 +451,10 @@ git commit -m "docs(ui): add enterprise refresh acceptance and release gates"
## Milestone Mapping
1. **M1 (Day 1-3):** Tasks 1-3 + sample page alignment.
1. **M1 (Day 1-3):** Tasks 1-3 + page alignment.
2. **M2 (Day 4-7):** Tasks 4-5 (first 6 core pages).
3. **M3 (Day 8-10):** Tasks 6-8 (remaining 4 pages + states).
4. **M4 (Day 11-14):** Task 9 + demo rehearsal + release gate.
4. **M4 (Day 11-14):** Task 9 + release rehearsal + release gate.
## Definition of Done
@@ -11,7 +11,7 @@
- Production schema source of truth becomes Alembic only.
- New production environments must start from an empty database.
- Production initialization explicitly runs schema migrations first, then ensures a fixed administrator account exists.
- No demo users, demo projects, demo fees, or any other seed business data are created in production initialization.
- No placeholder users, placeholder projects, placeholder fees, or any other seed business data are created in production initialization.
- The fixed administrator is `admin@huapont.cn` with initial password `admin123`.
- The fixed administrator cannot be deleted, disabled, downgraded from `ADMIN`, or have its email changed.
- The fixed administrator may change its password after first login.
@@ -29,7 +29,7 @@
4. Log in with `admin@huapont.cn / admin123`, then change the password.
**Non-Goals**
- No automatic demo data import.
- No automatic business seed import.
- No runtime auto-migration inside the long-lived backend container.
- No second schema definition maintained in `database/init.sql`.
@@ -2,7 +2,7 @@
> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.
**Goal:** Make production initialization use Alembic as the only schema source and seed exactly one protected administrator account with no demo data.
**Goal:** Make production initialization use Alembic as the only schema source and seed exactly one protected administrator account with no preloaded business data.
**Architecture:** A dedicated initialization entrypoint will run migrations and seed the protected administrator. The runtime backend container will stop relying on production startup side effects for database structure, and the user-management API will enforce immutability rules for the protected administrator account.
@@ -2,9 +2,9 @@
> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.
**Goal:** Stop development initialization from auto-creating any demo study or fee data.
**Goal:** Stop development initialization from auto-creating any placeholder study or fee data.
**Architecture:** Remove the application startup hook that seeds demo fee data, while keeping schema setup and protected admin initialization intact. Add a regression test that proves the lifespan startup no longer calls the demo seed helper.
**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
@@ -19,18 +19,18 @@
**Step 1: Write the failing test**
```python
async def test_development_startup_does_not_seed_demo_fees():
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 `seed_demo_fees`.
Expected: FAIL because startup still calls the old seed helper.
**Step 3: Write minimal implementation**
Remove the `seed_demo_fees` import and startup call from `backend/app/main.py`.
Remove the obsolete seed hook from `backend/app/main.py`.
**Step 4: Run test to verify it passes**