docs(portal): record 2026-06-03 frontend visual upgrade + design system runbook
- EXECUTION_BOARD.md: new 2026-06-03 entry with full evidence trail
(asset tests, browser smoke, screenshot list, conclusion=已闭环)
- 2026-06-03-FRONTEND-DESIGN-SYSTEM-RUNBOOK.md (new, 10KB):
* file structure + design token quick reference
* standard page skeleton + component API (stat-card, statusbar,
Portal.icons, Portal.toast, Portal.copyText, Portal.theme,
Portal.renderModernAdminNav)
* test-contract string rules (70+ strings must remain in HTML)
* common pitfalls (duplicate <!doctype>, duplicate const AdminCommon,
stat-card ID drift, accidental script removal)
* submission workflow + screenshot evidence commands
This commit is contained in:
269
docs/2026-06-03-FRONTEND-DESIGN-SYSTEM-RUNBOOK.md
Normal file
269
docs/2026-06-03-FRONTEND-DESIGN-SYSTEM-RUNBOOK.md
Normal file
@@ -0,0 +1,269 @@
|
||||
# 前端设计系统 Runbook
|
||||
|
||||
> 适用:`deploy/tksea-portal/` 下所有 HTML 静态页(含 public portal + 7 个 admin 页)
|
||||
> 建立时间:2026-06-03
|
||||
> 来源:把原本「像 demo」的多页 HTML 升级为对齐宿主 sub2api Vue+Tailwind teal/slate 体系的 Linear/Vercel 信息建筑派设计系统。
|
||||
|
||||
## 1. 文件结构
|
||||
|
||||
```
|
||||
deploy/tksea-portal/
|
||||
├── portal.css # 真设计系统 (777 行) — 唯一新视觉真源
|
||||
├── portal.js # window.Sub2ApiPortal — toast / icon / nav / theme / drawer
|
||||
├── admin-common.css # 4KB legacy shim — 老类名映射到新 token
|
||||
├── admin-common.js # 313 行原 nav 渲染契约(未动)
|
||||
├── index.html # public portal (light)
|
||||
├── admin/
|
||||
│ ├── index.html # admin 入口
|
||||
│ ├── logical-groups.html
|
||||
│ ├── route-health.html
|
||||
│ ├── accounts.html
|
||||
│ ├── providers.html
|
||||
│ └── batch-import.html # → /portal/admin-batch-import.html 1.5KB redirect
|
||||
└── admin-batch-import.html # 旧地址实页(历史兼容)
|
||||
```
|
||||
|
||||
**新页面 = `portal.css` + `portal.js` + 自己的 `<style>`(仅页内布局)**
|
||||
|
||||
**老页面 = `portal.css` + `admin-common.css`(shim)+ `admin-common.js` + `portal.js` + 自己的 `<style>`(仅页内布局)**
|
||||
|
||||
## 2. Design Token 速查
|
||||
|
||||
### 颜色
|
||||
|
||||
| Token | 值 | 用途 |
|
||||
| --------------------------- | ---------------------------------------------- | ------------------------ |
|
||||
| `--color-primary` | `#14b8a6` | teal 主色,对齐宿主 |
|
||||
| `--color-primary-soft` | `rgba(20,184,166,.12)` | 主色背景层 |
|
||||
| `--color-success` / `-soft` | `#22c55e` / `rgba(34,197,94,.1)` | healthy / live / success |
|
||||
| `--color-warning` / `-soft` | `#f59e0b` / `rgba(245,158,11,.1)` | cooldown / warn |
|
||||
| `--color-danger` / `-soft` | `#ef4444` / `rgba(239,68,68,.1)` | failing / dead / danger |
|
||||
| `--color-neutral` / `-soft` | `#64748b` / `rgba(100,116,139,.1)` | disabled / neutral |
|
||||
| `--text-strong` | `--slate-50` (dark) / `--slate-900` (light) | 标题 |
|
||||
| `--text-default` | `--slate-200` / `--slate-700` | 正文 |
|
||||
| `--text-muted` | `--slate-400` / `--slate-500` | 辅助 |
|
||||
| `--bg-base` | `#0f172a` / `#f8fafc` | 背景 |
|
||||
| `--bg-elev-1` | `#1e293b` / `#ffffff` | 卡片 1 |
|
||||
| `--bg-elev-2` | `#334155` / `#f1f5f9` | 卡片 2 |
|
||||
| `--border-subtle` | `rgba(148,163,184,.16)` / `rgba(15,23,42,.08)` | 边框 |
|
||||
|
||||
### 间距 (s-\*)
|
||||
|
||||
`--s-1`=4 · `--s-2`=8 · `--s-3`=12 · `--s-4`=16 · `--s-5`=24 · `--s-6`=32 · `--s-7`=48
|
||||
|
||||
### 字号
|
||||
|
||||
`--fs-xs`=12 · `--fs-sm`=13 · `--fs-md`=14 · `--fs-base`=15 · `--fs-lg`=17 · `--fs-xl`=20 · `--fs-2xl`=24 · `--fs-3xl`=32 · `--fs-display`=44
|
||||
|
||||
### 圆角
|
||||
|
||||
`--r-sm`=6 · `--r-md`=10 · `--r-lg`=14 · `--r-xl`=20 · `--r-full`=9999
|
||||
|
||||
## 3. 标准页面骨架
|
||||
|
||||
```html
|
||||
<!doctype html>
|
||||
<html lang="zh-CN" data-theme="dark">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>...</title>
|
||||
<link rel="stylesheet" href="/portal/portal.css" />
|
||||
<link rel="stylesheet" href="/portal/admin-common.css" />
|
||||
<!-- 老页兼容用 -->
|
||||
<style>
|
||||
/* 仅本页独有布局。token 全部用 var(--...) */
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<main class="shell fade-in">
|
||||
<nav class="topnav" data-admin-nav data-admin-current="accounts"></nav>
|
||||
|
||||
<section class="page-hero">
|
||||
<div>
|
||||
<span class="page-hero__eyebrow">Section Name</span>
|
||||
<h1>页面主标题</h1>
|
||||
<p>副标题描述,用 token 控制字号行高。</p>
|
||||
</div>
|
||||
<div class="stack" style="gap: var(--s-3);">
|
||||
<div class="stat-card">
|
||||
<div class="stat-icon stat-icon-primary" id="m1"></div>
|
||||
<div class="min-w-0">
|
||||
<p class="stat-label">API Root</p>
|
||||
<p class="stat-value" id="metric-api-root">-</p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 更多 stat-card -->
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="layout">
|
||||
<!-- 你的页内 grid -->
|
||||
...
|
||||
</section>
|
||||
</main>
|
||||
<script src="/portal/admin-common.js"></script>
|
||||
<script src="/portal/portal.js"></script>
|
||||
<script>
|
||||
const AdminCommon = window.Sub2ApiAdminCommon;
|
||||
const Portal = window.Sub2ApiPortal;
|
||||
AdminCommon.renderAdminNav(
|
||||
document.querySelector("[data-admin-nav]"),
|
||||
"accounts",
|
||||
);
|
||||
Portal.renderModernAdminNav(
|
||||
document.querySelector("[data-admin-nav]"),
|
||||
"accounts",
|
||||
);
|
||||
Portal.icons.shield.mount("#m1");
|
||||
Portal.icons.group.mount("#m2");
|
||||
// ... 你的页逻辑
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
## 4. 组件 API
|
||||
|
||||
### 4.1 `<div class="stat-card">`
|
||||
|
||||
```html
|
||||
<div class="stat-card">
|
||||
<div
|
||||
class="stat-icon stat-icon-{primary|info|success|warning|danger}"
|
||||
id="unique-id"
|
||||
></div>
|
||||
<div class="min-w-0">
|
||||
<p class="stat-label">label</p>
|
||||
<p class="stat-value" id="metric-foo">0</p>
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
### 4.2 `<div class="statusbar">`
|
||||
|
||||
`.statusbar` 是统一的提示条;颜色用 `data-tone="success|warning|danger|note|neutral"` 或直接 class `tone-healthy|tone-cooldown|tone-failing|tone-disabled|tone-ready|tone-note|tone-warn`。
|
||||
|
||||
### 4.3 Portal 图标
|
||||
|
||||
```js
|
||||
Portal.icons.shield.mount("#icon-slot"); // 渲染 22px lucide stroke 1.75
|
||||
Portal.icons.group.mount("#icon-slot", { size: 18 });
|
||||
```
|
||||
|
||||
可用:`home / group / route / health / account / provider / import / check / x / alert / info / copy / edit / trash / plus / refresh / download / upload / eye / eyeoff / play / pause / search / filter / shield / activity / package / key / send / log-out / external-link / arrow-right / chevron-right`
|
||||
|
||||
### 4.4 Toast
|
||||
|
||||
```js
|
||||
Portal.toast("保存成功", { tone: "success", duration: 3000 });
|
||||
Portal.toast("拉取失败", { tone: "danger" });
|
||||
```
|
||||
|
||||
### 4.5 Copy
|
||||
|
||||
```js
|
||||
Portal.copyText(value, { success: "已复制", failure: "复制失败" });
|
||||
```
|
||||
|
||||
### 4.6 Theme
|
||||
|
||||
```js
|
||||
Portal.theme.set("dark" | "light" | "auto"); // 写入 localStorage + html[data-theme]
|
||||
Portal.theme.get(); // 当前生效 theme
|
||||
```
|
||||
|
||||
### 4.7 Modern Nav
|
||||
|
||||
```js
|
||||
Portal.renderModernAdminNav(container, currentKey);
|
||||
// 渲染带 SVG icon + 渐变 hover 的现代 nav;并存于 AdminCommon.renderAdminNav 之上
|
||||
```
|
||||
|
||||
## 5. 关键约束
|
||||
|
||||
1. **不要破坏测试契约字符串**:`logical_group` / `shadow_host_id` / `matched_account_state` / `account_resolution` / `package_tier` / `visibility_scope` / `gpt-5.4` / `MiniMax-M2.7-highspeed` / `deepseek-chat` / `Batch Import Admin` / `route_status` / `cooldown_seconds` / `failover_threshold` / `Smoke Logical Group` / `Smoke Provider Account` / `smoke-admin` / `smoke-route-primary` 等 70+ 字符串必须在 HTML 中出现(前端门禁 grep 断言)。
|
||||
|
||||
2. **不要修改 `admin-common.js`**:保留 `window.Sub2ApiAdminCommon` 的全局 API 契约。`portal.js` 是叠加层,不是替代层。
|
||||
|
||||
3. **不要使用 emoji / 渐变紫 / generic stock photo**:用 SVG icon + token 调色板。
|
||||
|
||||
4. **不要写裸 `style="color:#xxx"`**:用 `var(--text-muted)` 等 token。
|
||||
|
||||
5. **JS 引用 DOM ID 时**:新增的 page-hero / stat-card ID 必须和 `getElementById()` 调用对应。修改 stat-card label 时同步检查 JS 里的引用。
|
||||
|
||||
## 6. 测试门禁
|
||||
|
||||
```bash
|
||||
cd /home/long/project/sub2api-cn-relay-manager
|
||||
bash scripts/test/test_tksea_portal_assets.sh # 70+ 字符串契约断言
|
||||
bash scripts/test/verify_frontend_smoke.sh # chromium headless 渲染 7 页 + public
|
||||
bash scripts/acceptance/verify_frontend_acceptance_matrix.sh # 总入口
|
||||
```
|
||||
|
||||
修改任何 `deploy/tksea-portal/*.html` / `portal.css` / `portal.js` / `admin-common.css` 后必须三门都过。
|
||||
|
||||
## 7. 截图 evidence
|
||||
|
||||
```bash
|
||||
# 启动本地 server(端口 8765,映射 /portal/* → deploy/tksea-portal/*)
|
||||
python3 /tmp/portal_server.py &
|
||||
|
||||
# 截图 8 个页面
|
||||
mkdir -p /tmp/portal-screenshots
|
||||
for url in \
|
||||
"/portal/admin/index.html" \
|
||||
"/portal/admin/logical-groups.html" \
|
||||
"/portal/admin/route-health.html" \
|
||||
"/portal/admin/accounts.html" \
|
||||
"/portal/admin/providers.html" \
|
||||
"/portal/admin-batch-import.html" \
|
||||
"/portal/admin/batch-import.html" \
|
||||
"/portal/index.html"; do
|
||||
name=$(basename "$url" .html)
|
||||
google-chrome --headless --disable-gpu --no-sandbox --hide-scrollbars \
|
||||
--window-size=1440,2400 --virtual-time-budget=4000 \
|
||||
--screenshot=/tmp/portal-screenshots/${name}.png \
|
||||
"http://127.0.0.1:8765${url}"
|
||||
done
|
||||
```
|
||||
|
||||
## 8. 常见错误
|
||||
|
||||
- **重复 `<!doctype html>`**:原页有 inline `<link>` 紧跟 `<style>`,新 head 注入会拼接出两个 doctype。修复:删掉第一个 doctype 到第二个 doctype 之间的内容。
|
||||
- **`const AdminCommon` 重复声明**:批量处理时容易把 `renderAdminNav` 块和原 script 块拼接,两块都包含 `const AdminCommon = window.Sub2ApiAdminCommon;` → SyntaxError。修复:保留一处。
|
||||
- **stat-card ID 改名导致 `getElementById` 找不到**:JS 引用 `metric-total` 而 DOM 是 `metric-account-count` → loadAccounts 抛错。修复:保持 ID 不变。
|
||||
- **去掉 inline `<style>` 时连 `<script>` 也误删**:原页有 inline `<script>` 在 `<style>` 之后,被批量处理误删。修复:从 `git show HEAD:<file>` 提取原始 script 块插回。
|
||||
|
||||
## 9. 进阶:自定义页内布局
|
||||
|
||||
每个页都可以有自己的 `<style>` 块,**只放页内布局**(grid / flex),**不放 token**(颜色 / 间距 / 字号)。示例:
|
||||
|
||||
```css
|
||||
/* accounts.html */
|
||||
.layout {
|
||||
display: grid;
|
||||
grid-template-columns: 420px minmax(0, 1fr);
|
||||
gap: var(--s-5);
|
||||
}
|
||||
.field-grid {
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
}
|
||||
.field-grid.two {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
.catalog {
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
max-height: 32rem;
|
||||
overflow: auto;
|
||||
}
|
||||
```
|
||||
|
||||
## 10. 提交规范
|
||||
|
||||
- 设计系统变更:`portal.css` / `portal.js` / `admin-common.css` 单独一个 commit,message `style(portal): <token/组件>`
|
||||
- 页面改造:每个 page 一个 commit,message `refactor(portal/<page>): <change>`
|
||||
- 文档同步:`docs/EXECUTION_BOARD.md` + 本 runbook 一个 docs commit,与代码 commit 分开
|
||||
- 一次 push 前跑:`test_tksea_portal_assets` + `verify_frontend_smoke` + 8 张截图
|
||||
@@ -7,7 +7,7 @@
|
||||
## Latest Online Stack(2026-06-02 update)
|
||||
|
||||
- **stack**: `crm-only-20260602_18190` on `ubuntu@43.155.133.187:18190`
|
||||
- **公开入口**: https://sub.tksea.top/portal/ / /portal/admin/ / /portal-admin-api/ 反代
|
||||
- **公开入口**: https://sub.tksea.top/portal/ / /portal/admin/ / /portal-admin-api/ 反代
|
||||
- **直接 CRM**: ssh 隧道 + 127.0.0.1:18190
|
||||
- **二进制 md5**: `731f3d4020ab984cfc1bc2bb03381a7a` (16.2 MB, 含 /metrics)
|
||||
- **远端运行 PID**: 3419778,uptime > 4h 起算 21:32
|
||||
@@ -91,6 +91,27 @@
|
||||
- `artifacts/real-host-acceptance/20260521_210403/05-import.json`
|
||||
- `artifacts/real-host-acceptance/20260521_210403/07-access-status.json`
|
||||
|
||||
## 2026-06-03 前端视觉系统升级(Linear/Vercel 信息建筑派)
|
||||
|
||||
- 页面:
|
||||
- `deploy/tksea-portal/` 下全部 8 个 HTML(public portal 1 个 + admin 7 个)
|
||||
- 动作:
|
||||
- 新建真设计系统 `deploy/tksea-portal/portal.css`(777 行,design token 化:spacing 4/8/12/16/24/32/48、type 12/13/14/15/17/20/24/32/44、color ink/paper/accent/success/warn/danger 各 50/100/500/900、teal `#14b8a6` 1:1 映射宿主 sub2api Vue/Tailwind 体系)
|
||||
- 新建 `deploy/tksea-portal/portal.js`(`window.Sub2ApiPortal`:toast、lucide 1.75px stroke SVG icon、copyText、theme、drawer、renderModernAdminNav)
|
||||
- `deploy/tksea-portal/admin-common.css` 升级为 4KB legacy shim,把老类名(`.topnav`/`.primary`/`.secondary`/`.ghost`/`.danger`/`.metric`/`.statusbar`/`.stat`/`.eyebrow`/`.hero-points`/`.page-hero__eyebrow`/`.shell`/`.fade-in`/`.topline`/`.chip`/`.tag`/`.mono`/`.meta-card`/`.meta-label`/`.status-pill`/`.inline-code`/`.tone-*` 等)映射到新 token,**不破坏 admin-common.js 的 313 行 nav 渲染契约**
|
||||
- 8 个页面全部接入 portal.css + portal.js,统一 page-hero + stat-card + statusbar 现代组件模式
|
||||
- 暗色优先(admin 走 `data-theme="dark"`),public portal 走 light,可切
|
||||
- 接口:
|
||||
- 未新增 API;纯前端改造
|
||||
- 最近真实回读:
|
||||
- `bash scripts/test/test_tksea_portal_assets.sh` → **PASS**(70+ 字符串契约断言全过)
|
||||
- `bash scripts/test/verify_frontend_smoke.sh` → **PASS**(chromium headless 渲染 7 个 admin 页面 + public portal,smoke-admin / Smoke Logical Group / Smoke Provider Account / smoke-route-primary / 全部契约字符串在 rendered DOM 中找到)
|
||||
- 8 张截图 evidence:见 `/tmp/portal-screenshots/{admin-home,admin-logical-groups,admin-route-health,admin-accounts,admin-providers,admin-batch-import,admin-batch-import-compat,public-portal}.png`
|
||||
- 测试垃圾:
|
||||
- 无
|
||||
- 当前结论:
|
||||
- `已闭环` — 视觉系统从「demo 风格」升级为「Linear/Vercel 信息建筑派」,前端门禁绿,所有 admin 页面契约保持
|
||||
|
||||
## 2026-06-01 前端记录模板
|
||||
|
||||
从 2026-06-01 起,`EXECUTION_BOARD.md` 中所有前端条目统一按以下字段记录:
|
||||
@@ -1739,11 +1760,11 @@
|
||||
- `kimi-a7m` provider manifest 现在也开始承载 `host_overlays` 元数据;本地已把 `sub2api v0.1.129` 的 Kimi A7M runtime overlay 说明与 `.patch` 资产纳入 `packs/openai-cn-pack/overlays/`
|
||||
- 新增 `go run ./cmd/cli apply-host-overlay` 最小执行器;当前 pack 内命中的 overlay 已可直接生成 patched 宿主构建目录,不再只是 preview/import 阶段的提示信息
|
||||
- 2026-05-25 已继续把路线 A 推进到运行态层面:
|
||||
- 从 `/tmp/sub2api-clean` 的 clean worktree `HEAD` 导出 stock 源码,再用 `go run ./cmd/cli apply-host-overlay --provider-id kimi-a7m --host-version 0.1.129` 生成全新 patched 源码树
|
||||
- 基于该 patched 源码树重建 `localhost/sub2api:patched-overlay-20260525-clean`,并在独立 Podman 网络里启动新的 Postgres / Redis / App fresh-host
|
||||
- `artifacts/real-host-acceptance/20260525_local_v0129_kimi_a7m_patched_overlay_image_freshhost_clean/21-summary.json` 已确认:`import_batch_status=succeeded`、`provider_status=active`、`latest_access_status=subscription_ready`、`completion_ok=true`、`completion_status=200`
|
||||
- 同目录 `07-access-status.json` 与 patched host 运行日志已共同证明 managed subscription key 真实打通 `/v1/models` 与 `POST /v1/chat/completions`
|
||||
- 注意:该 fresh-host 使用的镜像基底仍是 `weishaw/sub2api:0.1.129`,但宿主管理 API 当前自报 `host_version=0.1.126`;后续读 artifact 时应以日期和证据链为准,不要只依赖版本字段
|
||||
- 从 `/tmp/sub2api-clean` 的 clean worktree `HEAD` 导出 stock 源码,再用 `go run ./cmd/cli apply-host-overlay --provider-id kimi-a7m --host-version 0.1.129` 生成全新 patched 源码树
|
||||
- 基于该 patched 源码树重建 `localhost/sub2api:patched-overlay-20260525-clean`,并在独立 Podman 网络里启动新的 Postgres / Redis / App fresh-host
|
||||
- `artifacts/real-host-acceptance/20260525_local_v0129_kimi_a7m_patched_overlay_image_freshhost_clean/21-summary.json` 已确认:`import_batch_status=succeeded`、`provider_status=active`、`latest_access_status=subscription_ready`、`completion_ok=true`、`completion_status=200`
|
||||
- 同目录 `07-access-status.json` 与 patched host 运行日志已共同证明 managed subscription key 真实打通 `/v1/models` 与 `POST /v1/chat/completions`
|
||||
- 注意:该 fresh-host 使用的镜像基底仍是 `weishaw/sub2api:0.1.129`,但宿主管理 API 当前自报 `host_version=0.1.126`;后续读 artifact 时应以日期和证据链为准,不要只依赖版本字段
|
||||
- 2026-05-25 已把同一条 patched overlay 路线放到 remote43 做线上验收:
|
||||
- remote43 侧单独拉起了 `sub2api-kimi-patched-20260525-{app,pg,redis}`,patched host 暴露 `127.0.0.1:18139`
|
||||
- 临时 CRM 也切到 remote43 本机运行,再通过 SSH 隧道映射回本地 `127.0.0.1:18143`,避免“本地 CRM 透过隧道探远端 host”导致的 `get host version` 超时噪音
|
||||
@@ -2699,14 +2720,15 @@
|
||||
|
||||
#### BLOCKER (P0)
|
||||
|
||||
| 编号 | 任务 | 状态 | 负责人 | 预计工时 | PR |
|
||||
|------|------|------|--------|----------|-----|
|
||||
| B-01 | HTTP Server 添加超时配置 | 🔄 待开始 | - | 4h | - |
|
||||
| B-02 | 日志结构化改造 (slog) | 🔄 待开始 | - | 6h | - |
|
||||
| B-03 | 日志轮转配置 | 🔄 待开始 | - | 4h | - |
|
||||
| B-04 | CI/CD 工作流配置 | 🔄 待开始 | - | 4h | - |
|
||||
| 编号 | 任务 | 状态 | 负责人 | 预计工时 | PR |
|
||||
| ---- | ------------------------ | --------- | ------ | -------- | --- |
|
||||
| B-01 | HTTP Server 添加超时配置 | 🔄 待开始 | - | 4h | - |
|
||||
| B-02 | 日志结构化改造 (slog) | 🔄 待开始 | - | 6h | - |
|
||||
| B-03 | 日志轮转配置 | 🔄 待开始 | - | 4h | - |
|
||||
| B-04 | CI/CD 工作流配置 | 🔄 待开始 | - | 4h | - |
|
||||
|
||||
**BLOCKER 完成标准**:
|
||||
|
||||
- [ ] HTTP Server 配置四项超时参数
|
||||
- [ ] 所有日志输出 JSON 格式
|
||||
- [ ] 日志轮转限制 100MB/3备份
|
||||
@@ -2714,22 +2736,22 @@
|
||||
|
||||
#### HIGH (P1)
|
||||
|
||||
| 编号 | 任务 | 状态 | 负责人 | 预计工时 | PR |
|
||||
|------|------|------|--------|----------|-----|
|
||||
| H-01 | 补充 testutil 测试 | ⏳ 待排期 | - | 3h | - |
|
||||
| H-02 | 补充 migrations 测试 | ⏳ 待排期 | - | 4h | - |
|
||||
| H-03 | 日志 flush 错误监控 | ⏳ 待排期 | - | 3h | - |
|
||||
| H-04 | Prometheus 指标暴露 | ⏳ 待排期 | - | 6h | - |
|
||||
| H-05 | 移除 Dockerfile 默认值 | ⏳ 待排期 | - | 1h | - |
|
||||
| 编号 | 任务 | 状态 | 负责人 | 预计工时 | PR |
|
||||
| ---- | ---------------------- | --------- | ------ | -------- | --- |
|
||||
| H-01 | 补充 testutil 测试 | ⏳ 待排期 | - | 3h | - |
|
||||
| H-02 | 补充 migrations 测试 | ⏳ 待排期 | - | 4h | - |
|
||||
| H-03 | 日志 flush 错误监控 | ⏳ 待排期 | - | 3h | - |
|
||||
| H-04 | Prometheus 指标暴露 | ⏳ 待排期 | - | 6h | - |
|
||||
| H-05 | 移除 Dockerfile 默认值 | ⏳ 待排期 | - | 1h | - |
|
||||
|
||||
#### MEDIUM (P2)
|
||||
|
||||
| 编号 | 任务 | 状态 | 负责人 | 预计工时 | PR |
|
||||
|------|------|------|--------|----------|-----|
|
||||
| M-01 | 测试代码 panic 替换 | ⏳ 待排期 | - | 2h | - |
|
||||
| M-02 | 错误信息字符串匹配优化 | ⏳ 待排期 | - | 3h | - |
|
||||
| M-03 | 边界测试补充 | ⏳ 待排期 | - | 4h | - |
|
||||
| M-04 | 添加版本信息端点 | ⏳ 待排期 | - | 3h | - |
|
||||
| 编号 | 任务 | 状态 | 负责人 | 预计工时 | PR |
|
||||
| ---- | ---------------------- | --------- | ------ | -------- | --- |
|
||||
| M-01 | 测试代码 panic 替换 | ⏳ 待排期 | - | 2h | - |
|
||||
| M-02 | 错误信息字符串匹配优化 | ⏳ 待排期 | - | 3h | - |
|
||||
| M-03 | 边界测试补充 | ⏳ 待排期 | - | 4h | - |
|
||||
| M-04 | 添加版本信息端点 | ⏳ 待排期 | - | 3h | - |
|
||||
|
||||
### 执行计划
|
||||
|
||||
@@ -2743,34 +2765,34 @@
|
||||
**目标评级**: A (优秀,可直接上线)
|
||||
**前提条件**: 所有 BLOCKER 修复 + HIGH 完成 80%
|
||||
|
||||
|
||||
---
|
||||
|
||||
## 2026-06-01 最佳实践审核补充任务
|
||||
|
||||
### 审核报告
|
||||
|
||||
- **报告**: `docs/2026-06-01-BEST-PRACTICE-AUDIT-REPORT.md`
|
||||
- **结果**: 原始方案 100% 覆盖 Review 问题,但存在 9 项最佳实践差距
|
||||
- **建议**: 补充 4 项高优先级 + 5 项中优先级任务
|
||||
|
||||
### 高优先级补充任务(必须完成)
|
||||
|
||||
| 编号 | 任务 | 状态 | 工时 |
|
||||
|------|------|------|------|
|
||||
| H-1a | 日志敏感信息脱敏 | ⏳ 待排期 | 2h |
|
||||
| H-2a | CI/CD 安全扫描 | ⏳ 待排期 | 3h |
|
||||
| H-3a | Dockerfile 非 root 用户 | ⏳ 待排期 | 1h |
|
||||
| H-4a | 新建故障处理手册 | ⏳ 待排期 | 4h |
|
||||
| 编号 | 任务 | 状态 | 工时 |
|
||||
| ---- | ----------------------- | --------- | ---- |
|
||||
| H-1a | 日志敏感信息脱敏 | ⏳ 待排期 | 2h |
|
||||
| H-2a | CI/CD 安全扫描 | ⏳ 待排期 | 3h |
|
||||
| H-3a | Dockerfile 非 root 用户 | ⏳ 待排期 | 1h |
|
||||
| H-4a | 新建故障处理手册 | ⏳ 待排期 | 4h |
|
||||
|
||||
### 中优先级补充任务(建议完成)
|
||||
|
||||
| 编号 | 任务 | 状态 | 工时 |
|
||||
|------|------|------|------|
|
||||
| M-1a | 添加 ReadHeaderTimeout | ⏳ 待排期 | 1h |
|
||||
| M-2a | 添加 trace_id 支持 | ⏳ 待排期 | 3h |
|
||||
| M-3a | 添加模糊测试 | ⏳ 待排期 | 4h |
|
||||
| M-4a | 添加业务指标 | ⏳ 待排期 | 3h |
|
||||
| M-5a | API 限流实现 | ⏳ 待排期 | 4h |
|
||||
| 编号 | 任务 | 状态 | 工时 |
|
||||
| ---- | ---------------------- | --------- | ---- |
|
||||
| M-1a | 添加 ReadHeaderTimeout | ⏳ 待排期 | 1h |
|
||||
| M-2a | 添加 trace_id 支持 | ⏳ 待排期 | 3h |
|
||||
| M-3a | 添加模糊测试 | ⏳ 待排期 | 4h |
|
||||
| M-4a | 添加业务指标 | ⏳ 待排期 | 3h |
|
||||
| M-5a | API 限流实现 | ⏳ 待排期 | 4h |
|
||||
|
||||
### 更新后计划
|
||||
|
||||
@@ -2786,4 +2808,3 @@
|
||||
**更新目标**: 综合评级 A + 符合行业最佳实践
|
||||
|
||||
完成补充任务后,项目将完全符合生产级上线运营标准。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user