release(main): 清理本地配置并重组文档结构
This commit is contained in:
@@ -409,8 +409,8 @@ git commit -m "feat(ui): unify loading empty error states"
|
||||
### Task 9: Verification, Demo Path, and Release Gate
|
||||
|
||||
**Files:**
|
||||
- Create: `docs/ui/enterprise-ui-acceptance-checklist.md`
|
||||
- Modify: `docs/release-checklist.md`
|
||||
- Create: `docs/audits/enterprise-ui-acceptance-checklist.md`
|
||||
- Modify: `docs/guides/release-checklist.md`
|
||||
- Test: manual smoke + build checks
|
||||
|
||||
**Step 1: Write the failing test**
|
||||
@@ -435,7 +435,7 @@ Expected: PASS technically, but acceptance checklist remains FAIL/PENDING.
|
||||
|
||||
- Execute manual smoke on target routes.
|
||||
- Update checklist to PASS with reviewer/date notes.
|
||||
- Add release gating notes to `docs/release-checklist.md`.
|
||||
- Add release gating notes to `docs/guides/release-checklist.md`.
|
||||
|
||||
**Step 4: Run test to verify it passes**
|
||||
|
||||
@@ -445,7 +445,7 @@ Expected: PASS for all commands and checklist completed.
|
||||
**Step 5: Commit**
|
||||
|
||||
```bash
|
||||
git add docs/ui/enterprise-ui-acceptance-checklist.md docs/release-checklist.md
|
||||
git add docs/audits/enterprise-ui-acceptance-checklist.md docs/guides/release-checklist.md
|
||||
git commit -m "docs(ui): add enterprise refresh acceptance and release gates"
|
||||
```
|
||||
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
# 研发项目进展监测系统(rd-monitor)设计文档
|
||||
|
||||
## 1. 目标与范围
|
||||
- 基于现有 CTMS 的界面/组件经验,建设一个完全独立的研发项目进展监测系统。
|
||||
- 新系统独立前后端、独立数据库、独立鉴权与权限体系。
|
||||
- 首期仅实现 PDF《项目进度概览 v2》中的核心功能:概览展示、进度录入、历史变更、导出、项目隐藏规则。
|
||||
|
||||
## 2. 系统边界
|
||||
- 独立仓库:`rd-monitor`
|
||||
- 技术栈:Vue3 + Element Plus + FastAPI + SQLAlchemy + Alembic + PostgreSQL
|
||||
- 与 CTMS 关系:仅复用可迁移的组件/样式实现,不依赖 CTMS API 与 CTMS 数据表。
|
||||
|
||||
## 3. 数据模型
|
||||
### 3.1 users
|
||||
- `id`
|
||||
- `username`
|
||||
- `email`
|
||||
- `password_hash`
|
||||
- `role` (`ADMIN`/`PM`/`VIEWER`)
|
||||
- `is_active`
|
||||
- `created_at`
|
||||
|
||||
### 3.2 projects
|
||||
- `id`
|
||||
- `project_code`(如 HP-001)
|
||||
- `project_name`
|
||||
- `regulatory_path`
|
||||
- `status`(`ACTIVE`/`APPROVED`/`TERMINATED`)
|
||||
- `created_at`
|
||||
|
||||
### 3.3 stage_templates
|
||||
- `id`
|
||||
- `stage_key`
|
||||
- `stage_name`
|
||||
- `order_no`
|
||||
- `regulatory_paths`(JSON 数组;空表示通用)
|
||||
- `is_active`
|
||||
|
||||
### 3.4 project_stages
|
||||
- `id`
|
||||
- `project_id`
|
||||
- `stage_template_id`
|
||||
- `order_no`
|
||||
- `planned_start_date`
|
||||
- `planned_end_date`
|
||||
- `actual_finish_date`
|
||||
- `actual_finish_flag`(`DONE`/`NOT_APPLICABLE`/`PENDING`)
|
||||
- `adjust_reason`
|
||||
- `remark`
|
||||
- `updated_at`
|
||||
|
||||
### 3.5 project_stage_change_logs
|
||||
- `id`
|
||||
- `project_stage_id`
|
||||
- `changed_by`
|
||||
- `before_json`
|
||||
- `after_json`
|
||||
- `comment`
|
||||
- `created_at`
|
||||
|
||||
## 4. 状态规则(按 PDF)
|
||||
- `已完成`:`actual_finish_flag = DONE` 且 `actual_finish_date` 有值。
|
||||
- `未进行`:`actual_finish_flag = NOT_APPLICABLE`(“此阶段不开展”)。
|
||||
- `正进行`:当前阶段未完成/未进行,且上一阶段状态为 `已完成`。
|
||||
- `未开始`:其余情况。
|
||||
- 概览显示日期:使用 `planned_end_date`。
|
||||
- 项目隐藏:`APPROVED` 或 `TERMINATED` 不在概览列表中显示。
|
||||
|
||||
## 5. 页面与交互
|
||||
- 登录页(JWT)
|
||||
- 概览页:按项目展示阶段节点、计划完成日期、状态图例
|
||||
- 录入页:项目阶段表格编辑,支持“此阶段不开展”
|
||||
- 历史页:阶段变更历史时间线/表格
|
||||
- 导出:授权用户导出 CSV
|
||||
|
||||
## 6. 权限模型
|
||||
- `ADMIN`:用户/项目/模板管理 + 全部导出
|
||||
- `PM`:项目进度录入、历史查看、导出
|
||||
- `VIEWER`:只读(概览、历史)
|
||||
|
||||
## 7. API(首期)
|
||||
- `POST /api/v1/auth/login`
|
||||
- `GET /api/v1/auth/me`
|
||||
- `GET /api/v1/projects`
|
||||
- `POST /api/v1/projects`(ADMIN)
|
||||
- `GET /api/v1/stage-templates`
|
||||
- `POST /api/v1/stage-templates`(ADMIN)
|
||||
- `GET /api/v1/projects/{id}/stages`
|
||||
- `PATCH /api/v1/projects/{id}/stages/{stageId}`(PM/ADMIN)
|
||||
- `GET /api/v1/projects/{id}/stages/history`
|
||||
- `GET /api/v1/projects/stages/export?format=csv`(PM/ADMIN)
|
||||
|
||||
## 8. 验收标准
|
||||
- 状态计算规则与 PDF 一致
|
||||
- 录入保存会生成历史记录
|
||||
- 导出字段与录入字段一致
|
||||
- `APPROVED/TERMINATED` 项目不在概览展示
|
||||
@@ -1,137 +0,0 @@
|
||||
# rd-monitor Implementation Plan
|
||||
|
||||
> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.
|
||||
|
||||
**Goal:** 搭建独立仓库 `rd-monitor`,实现研发项目进展监测 MVP(独立鉴权、项目阶段录入、状态计算、历史留痕、CSV 导出、前端可用界面)。
|
||||
|
||||
**Architecture:** 后端采用 FastAPI + SQLAlchemy + PostgreSQL,提供鉴权、项目阶段、历史、导出 API;前端采用 Vue3 + Element Plus,提供登录、概览、录入、历史页面。通过 Docker Compose 启动前后端与独立 PostgreSQL。
|
||||
|
||||
**Tech Stack:** Vue3, Vite, Element Plus, FastAPI, SQLAlchemy, Alembic, PostgreSQL, JWT, Pytest
|
||||
|
||||
---
|
||||
|
||||
### Task 1: 初始化仓库结构与运行骨架
|
||||
|
||||
**Files:**
|
||||
- Create: `/Users/zcc/MyCTMS/rd-monitor/README.md`
|
||||
- Create: `/Users/zcc/MyCTMS/rd-monitor/docker-compose.yml`
|
||||
- Create: `/Users/zcc/MyCTMS/rd-monitor/backend/requirements.txt`
|
||||
- Create: `/Users/zcc/MyCTMS/rd-monitor/backend/.env.example`
|
||||
- Create: `/Users/zcc/MyCTMS/rd-monitor/frontend/package.json`
|
||||
- Create: `/Users/zcc/MyCTMS/rd-monitor/frontend/vite.config.ts`
|
||||
|
||||
**Step 1: Write the failing test**
|
||||
- 编写后端 smoke 测试,断言 `/healthz` 返回 200(此时接口不存在,应失败)。
|
||||
|
||||
**Step 2: Run test to verify it fails**
|
||||
- Run: `cd /Users/zcc/MyCTMS/rd-monitor/backend && pytest -q`
|
||||
- Expected: FAIL(缺少 app 或路由)。
|
||||
|
||||
**Step 3: Write minimal implementation**
|
||||
- 建立 FastAPI app 与 `/healthz` 路由,补全基础依赖与 compose。
|
||||
|
||||
**Step 4: Run test to verify it passes**
|
||||
- Run: `cd /Users/zcc/MyCTMS/rd-monitor/backend && pytest -q`
|
||||
- Expected: PASS。
|
||||
|
||||
**Step 5: Commit**
|
||||
- `git add ... && git commit -m "chore: bootstrap rd-monitor skeleton"`
|
||||
|
||||
### Task 2: 实现后端核心领域模型与状态计算
|
||||
|
||||
**Files:**
|
||||
- Create: `/Users/zcc/MyCTMS/rd-monitor/backend/app/models/*.py`
|
||||
- Create: `/Users/zcc/MyCTMS/rd-monitor/backend/app/services/progress.py`
|
||||
- Test: `/Users/zcc/MyCTMS/rd-monitor/backend/tests/test_progress_status.py`
|
||||
|
||||
**Step 1: Write the failing test**
|
||||
- 用测试覆盖阶段状态计算(已完成/未进行/正进行/未开始)与项目过滤规则。
|
||||
|
||||
**Step 2: Run test to verify it fails**
|
||||
- Run: `pytest tests/test_progress_status.py -q`
|
||||
- Expected: FAIL。
|
||||
|
||||
**Step 3: Write minimal implementation**
|
||||
- 实现状态计算函数与项目过滤函数。
|
||||
|
||||
**Step 4: Run test to verify it passes**
|
||||
- Run: `pytest tests/test_progress_status.py -q`
|
||||
- Expected: PASS。
|
||||
|
||||
**Step 5: Commit**
|
||||
- `git commit -m "feat: add progress status domain rules"`
|
||||
|
||||
### Task 3: 实现鉴权、项目阶段 API、历史记录与导出
|
||||
|
||||
**Files:**
|
||||
- Create/Modify: `/Users/zcc/MyCTMS/rd-monitor/backend/app/api/*.py`
|
||||
- Create/Modify: `/Users/zcc/MyCTMS/rd-monitor/backend/app/schemas/*.py`
|
||||
- Create/Modify: `/Users/zcc/MyCTMS/rd-monitor/backend/app/core/security.py`
|
||||
- Test: `/Users/zcc/MyCTMS/rd-monitor/backend/tests/test_stage_api.py`
|
||||
|
||||
**Step 1: Write the failing test**
|
||||
- 测试登录、查询项目阶段、更新阶段后历史新增、导出 CSV、权限拦截。
|
||||
|
||||
**Step 2: Run test to verify it fails**
|
||||
- Run: `pytest tests/test_stage_api.py -q`
|
||||
- Expected: FAIL。
|
||||
|
||||
**Step 3: Write minimal implementation**
|
||||
- 完成相关 API 与依赖。
|
||||
|
||||
**Step 4: Run test to verify it passes**
|
||||
- Run: `pytest tests/test_stage_api.py -q`
|
||||
- Expected: PASS。
|
||||
|
||||
**Step 5: Commit**
|
||||
- `git commit -m "feat: implement progress APIs with auth history and export"`
|
||||
|
||||
### Task 4: 实现前端登录、概览、录入、历史页面
|
||||
|
||||
**Files:**
|
||||
- Create: `/Users/zcc/MyCTMS/rd-monitor/frontend/src/views/*.vue`
|
||||
- Create: `/Users/zcc/MyCTMS/rd-monitor/frontend/src/router/index.ts`
|
||||
- Create: `/Users/zcc/MyCTMS/rd-monitor/frontend/src/api/*.ts`
|
||||
- Create: `/Users/zcc/MyCTMS/rd-monitor/frontend/src/components/*.vue`
|
||||
|
||||
**Step 1: Write the failing test**
|
||||
- 首期用类型检查/构建作为回归保护,先运行应失败(页面未实现)。
|
||||
|
||||
**Step 2: Run test to verify it fails**
|
||||
- Run: `cd /Users/zcc/MyCTMS/rd-monitor/frontend && npm run build`
|
||||
- Expected: FAIL。
|
||||
|
||||
**Step 3: Write minimal implementation**
|
||||
- 实现可登录、可浏览项目阶段、可编辑阶段、可看历史、可导出。
|
||||
|
||||
**Step 4: Run test to verify it passes**
|
||||
- Run: `npm run build`
|
||||
- Expected: PASS。
|
||||
|
||||
**Step 5: Commit**
|
||||
- `git commit -m "feat: add frontend pages for monitoring workflow"`
|
||||
|
||||
### Task 5: 联调与最终验证
|
||||
|
||||
**Files:**
|
||||
- Modify: `/Users/zcc/MyCTMS/rd-monitor/README.md`
|
||||
|
||||
**Step 1: Write the failing test**
|
||||
- 先运行端到端 smoke(未配置好前应失败)。
|
||||
|
||||
**Step 2: Run test to verify it fails**
|
||||
- Run: `docker compose up --build -d && curl -f http://localhost:8010/healthz`
|
||||
- Expected: 初次 FAIL 或服务未就绪。
|
||||
|
||||
**Step 3: Write minimal implementation**
|
||||
- 修正配置/环境变量/文档。
|
||||
|
||||
**Step 4: Run test to verify it passes**
|
||||
- Run: `docker compose up --build -d`
|
||||
- Run: `curl -f http://localhost:8010/healthz`
|
||||
- Run: `cd backend && pytest -q`
|
||||
- Run: `cd frontend && npm run build`
|
||||
- Expected: 全部 PASS。
|
||||
|
||||
**Step 5: Commit**
|
||||
- `git commit -m "docs: finalize rd-monitor setup and verification"`
|
||||
@@ -112,7 +112,7 @@ git commit -m "feat: add production init entrypoint"
|
||||
**Files:**
|
||||
- Modify: `docker-compose.yaml`
|
||||
- Modify: `README.md`
|
||||
- Modify: `docs/release-checklist.md`
|
||||
- Modify: `docs/guides/release-checklist.md`
|
||||
- Optionally modify: `database/init.sql`
|
||||
|
||||
**Step 1: Write failing verification**
|
||||
@@ -136,7 +136,7 @@ Expected: PASS with the new init workflow represented in configuration or docume
|
||||
**Step 5: Commit**
|
||||
|
||||
```bash
|
||||
git add docker-compose.yaml README.md docs/release-checklist.md database/init.sql
|
||||
git add docker-compose.yaml README.md docs/guides/release-checklist.md database/init.sql
|
||||
git commit -m "docs: define production database init flow"
|
||||
```
|
||||
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
# Docs Reorganization Implementation Plan
|
||||
|
||||
> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.
|
||||
|
||||
**Goal:** Reorganize `docs/` into stable long-lived sections, remove obsolete files, normalize document headers, and repair repository references.
|
||||
|
||||
**Architecture:** Keep `docs/plans/` as historical implementation records, move active operating material into `docs/guides/`, move review and governance material into `docs/audits/`, keep `docs/postman/` for collection assets, and add `docs/README.md` as the top-level navigation entrypoint.
|
||||
|
||||
**Tech Stack:** Markdown, shell file operations, ripgrep
|
||||
|
||||
---
|
||||
|
||||
### Task 1: Create the target docs structure
|
||||
|
||||
**Files:**
|
||||
- Create: `/Users/zcc/MyCTMS/ctms-dev/.worktrees/main/docs/README.md`
|
||||
- Create: `/Users/zcc/MyCTMS/ctms-dev/.worktrees/main/docs/guides/`
|
||||
- Create: `/Users/zcc/MyCTMS/ctms-dev/.worktrees/main/docs/audits/`
|
||||
|
||||
**Step 1: Write the failing test**
|
||||
|
||||
Manual expectation: `docs/README.md`, `docs/guides/`, and `docs/audits/` do not yet exist.
|
||||
|
||||
**Step 2: Run test to verify it fails**
|
||||
|
||||
Run: `find docs -maxdepth 1 -type d -o -type f | sort`
|
||||
Expected: FAIL to show the new structure.
|
||||
|
||||
**Step 3: Write minimal implementation**
|
||||
|
||||
Create the new directories and the docs index file.
|
||||
|
||||
**Step 4: Run test to verify it passes**
|
||||
|
||||
Run: `find docs -maxdepth 2 | sort`
|
||||
Expected: PASS with `docs/README.md`, `docs/guides`, and `docs/audits`.
|
||||
|
||||
### Task 2: Move active docs into semantic directories
|
||||
|
||||
**Files:**
|
||||
- Modify: `/Users/zcc/MyCTMS/ctms-dev/.worktrees/main/docs/guides/release-checklist.md`
|
||||
- Modify: `/Users/zcc/MyCTMS/ctms-dev/.worktrees/main/docs/guides/setup-config-api.md`
|
||||
- Modify: `/Users/zcc/MyCTMS/ctms-dev/.worktrees/main/docs/audits/auth-session-acceptance.md`
|
||||
- Modify: `/Users/zcc/MyCTMS/ctms-dev/.worktrees/main/docs/audits/setup-config-code-audit.md`
|
||||
- Modify: `/Users/zcc/MyCTMS/ctms-dev/.worktrees/main/docs/audits/storage-persistence-audit.md`
|
||||
- Modify: `/Users/zcc/MyCTMS/ctms-dev/.worktrees/main/docs/audits/storage-persistence-governance.md`
|
||||
- Modify: `/Users/zcc/MyCTMS/ctms-dev/.worktrees/main/docs/audits/enterprise-ui-acceptance-checklist.md`
|
||||
|
||||
**Step 1: Write the failing test**
|
||||
|
||||
Manual expectation: the documents still live in mixed root paths.
|
||||
|
||||
**Step 2: Run test to verify it fails**
|
||||
|
||||
Run: `find docs -maxdepth 2 -type f | sort`
|
||||
Expected: FAIL to show the desired grouping.
|
||||
|
||||
**Step 3: Write minimal implementation**
|
||||
|
||||
Move each document into `guides/` or `audits/`.
|
||||
|
||||
**Step 4: Run test to verify it passes**
|
||||
|
||||
Run: `find docs -maxdepth 2 -type f | sort`
|
||||
Expected: PASS with the regrouped files.
|
||||
|
||||
### Task 3: Remove obsolete docs and local artifacts
|
||||
|
||||
**Files:**
|
||||
- Delete: `/Users/zcc/MyCTMS/ctms-dev/.worktrees/main/docs/workbench-ui-optimization.md`
|
||||
- Delete: `/Users/zcc/MyCTMS/ctms-dev/.worktrees/main/docs/plans/2026-03-05-rd-monitor-design.md`
|
||||
- Delete: `/Users/zcc/MyCTMS/ctms-dev/.worktrees/main/docs/plans/2026-03-05-rd-monitor-implementation.md`
|
||||
|
||||
**Step 1: Write the failing test**
|
||||
|
||||
Manual expectation: the obsolete files still appear in `git status`.
|
||||
|
||||
**Step 2: Run test to verify it fails**
|
||||
|
||||
Run: `git status --short docs`
|
||||
Expected: FAIL because the obsolete docs are still present in tracked history.
|
||||
|
||||
**Step 3: Write minimal implementation**
|
||||
|
||||
Remove the obsolete files from the working tree and index.
|
||||
|
||||
**Step 4: Run test to verify it passes**
|
||||
|
||||
Run: `find docs -maxdepth 2 -type f | sort`
|
||||
Expected: PASS without the removed files.
|
||||
|
||||
### Task 4: Normalize titles, metadata, and references
|
||||
|
||||
**Files:**
|
||||
- Modify: `/Users/zcc/MyCTMS/ctms-dev/.worktrees/main/docs/README.md`
|
||||
- Modify: `/Users/zcc/MyCTMS/ctms-dev/.worktrees/main/README.md`
|
||||
- Modify: `/Users/zcc/MyCTMS/ctms-dev/.worktrees/main/.gitignore`
|
||||
- Modify: moved docs under `docs/guides/` and `docs/audits/`
|
||||
|
||||
**Step 1: Write the failing test**
|
||||
|
||||
Manual expectation: old paths are still referenced and several docs use inconsistent headings.
|
||||
|
||||
**Step 2: Run test to verify it fails**
|
||||
|
||||
Run: `rg -n "docs/(release-checklist|setup-config-api|storage-persistence|auth-session-acceptance|ui/enterprise-ui-acceptance-checklist)" README.md docs backend frontend .github`
|
||||
Expected: FAIL with old path references.
|
||||
|
||||
**Step 3: Write minimal implementation**
|
||||
|
||||
Update headings, add concise metadata blocks where useful, write `docs/README.md`, and fix references to the new paths.
|
||||
|
||||
**Step 4: Run test to verify it passes**
|
||||
|
||||
Run: `rg -n "docs/(release-checklist|setup-config-api|storage-persistence|auth-session-acceptance|ui/enterprise-ui-acceptance-checklist)" README.md docs backend frontend .github`
|
||||
Expected: PASS with only the new organized paths.
|
||||
Reference in New Issue
Block a user