docs: 单负责人执行计划 — handoff 对齐、生产验收、prune 加固

计划见 docs/design/plans/2026-06-01-single-owner-execution.md;生产 health/app/Redis/MySQL 已通过。
This commit is contained in:
Your Name
2026-06-01 14:09:17 +08:00
parent b8af1fc418
commit 24b4439b2b
6 changed files with 145 additions and 25 deletions
+6 -9
View File
@@ -143,18 +143,15 @@ cd frontend && npm run dev # http://localhost:3000/app/
| 终端页 | frontend/src/pages/TerminalPage.vue | | 终端页 | frontend/src/pages/TerminalPage.vue |
| Vite 配置 | frontend/vite.config.mts | | Vite 配置 | frontend/vite.config.mts |
## 已知待续事项 ## 已知待续事项2026-06-01
已修复:批量 Agent、JWT 60min+refresh、script-callback API Key、未知心跳丢弃、Admin 列迁移 — 见 `docs/changelog/2026-06-01-bug-remediation.md`。
| 优先级 | 问题 | 文件 | | 优先级 | 问题 | 文件 |
|--------|------|------| |--------|------|------|
| P1 | 批量操作按钮无反应 | ServersPage.vue | | P2 | 422 handler 是否精简 | server/main.py |
| P1 | agent script-callback 无 API Key 认证 | server/api/agent.py | | UX | 终端命令栏高亮对齐 | TerminalPage.vue |
| P1 | 访问令牌 30 天有效期过长 | server/config.py | | 验收 | 告警/Telegram、WebSSH、Sync、三层守护 | 见 handoff §八 |
| P2 | 47.121.118.30 持续发 422 | server/api/agent.py |
| P2 | 422 调试日志是临时的 | server/main.py |
| P2 | Admin 废弃列未清理 | server/domain/models/__init__.py |
| P3 | agent.py on_event 弃用 | server/api/agent.py |
| UX | 命令输入栏高亮对齐偏差 | TerminalPage.vue |
## 协作方式(单 Agent ## 协作方式(单 Agent
+8 -2
View File
@@ -27,8 +27,14 @@ echo "✓ Upload complete"
echo "▶ Deploying on server..." echo "▶ Deploying on server..."
ssh nexus "cd /www/wwwroot/api.synaglobal.vip/web/app && tar xzf /tmp/nexus-frontend.tar.gz && rm /tmp/nexus-frontend.tar.gz" ssh nexus "cd /www/wwwroot/api.synaglobal.vip/web/app && tar xzf /tmp/nexus-frontend.tar.gz && rm /tmp/nexus-frontend.tar.gz"
echo "▶ Pruning orphaned assets (dry-run first)..." echo "▶ Pruning orphaned assets (dry-run first)..."
ssh nexus "python3 /www/wwwroot/api.synaglobal.vip/deploy/prune_frontend_assets.py --dry-run" if ! ssh nexus "python3 /www/wwwroot/api.synaglobal.vip/deploy/prune_frontend_assets.py --dry-run"; then
ssh nexus "python3 /www/wwwroot/api.synaglobal.vip/deploy/prune_frontend_assets.py" echo "✗ Prune dry-run failed — aborting (no files deleted)"
exit 1
fi
if ! ssh nexus "python3 /www/wwwroot/api.synaglobal.vip/deploy/prune_frontend_assets.py"; then
echo "✗ Prune failed — check index.html references before retry"
exit 1
fi
echo "✓ Extracted and pruned" echo "✓ Extracted and pruned"
# 5. Restart backend # 5. Restart backend
@@ -0,0 +1,49 @@
# Changelog — 单负责人执行计划收口
**日期**: 2026-06-01
**类型**: 文档 / 部署流程 / 生产验证
## 摘要
`docs/design/plans/2026-06-01-single-owner-execution.md` 完成:推送 b8af1fc、生产同步、handoff/cursorrules 对齐、生产冒烟验收、前端部署脚本 prune 失败即中止。
## 动机
用户指定「只与当前 Agent 对话」后,需把仓库文档与生产状态对齐,并留下可复查的验收记录。
## 涉及文件
- `docs/design/plans/2026-06-01-single-owner-execution.md`(新)
- `docs/handoff-2026-06-01.md` — 第八节:已修复 vs 待抽测
- `.cursorrules` — 已知待续同步
- `deploy/deploy-frontend.sh` — prune 两步均检查退出码
- `docs/reports/2026-06-01-production-verification.md`(新)
## Git / 生产
- 推送:`b8af1fc``origin/main`
- 生产:`git reset --hard origin/main` @ b8af1fc`supervisorctl restart nexus`
## 验证(2026-06-01 生产机)
```text
/health → ok
/app/ → HTTP 200
supervisor → nexus RUNNING
redis-cli → PONG
mysql → SELECT 1 ok
```
生产未安装 `pytest``tests/test_api.py` 以本地/WSL CI 为准(历史记录 25/25)。
## 仍待用户抽测
告警+Telegram、WebSSH 长会话、Sync 试推、三层守护 kill — 见 `docs/reports/2026-06-01-production-verification.md`
## 迁移 / 重启
生产已重启一次(拉取文档/规则)。无 DB 迁移。
## 回滚
文档:`git revert` 本提交。生产:`git reset --hard` 上一 commit 后 `supervisorctl restart nexus`
@@ -0,0 +1,28 @@
# 执行计划 — 单负责人收口(2026-06-01
> **负责人**:当前 Cursor Agent(用户唯一对接人)
> **顺序**:推送同步 → 文档对齐 → 生产验收 → 前端部署加固 → changelog
## 任务清单
| # | 任务 | 验收标准 | 状态 |
|---|------|----------|------|
| T1 | `git push origin main`(含 b8af1fc | 远程 main 含单 Agent 提交 | ✅ |
| T2 | 生产 `git pull` + 重启(仅文档/规则,无前端 build) | `curl /health``ok` | ✅ |
| T3 | 刷新 `docs/handoff-2026-06-01.md` 第八节 | 已修复项标 ✅;主栈写 Vue SPA | ✅ |
| T4 | 刷新 `.cursorrules` 已知待续 | 与 T3 一致 | ✅ |
| T5 | 生产 L5 验收(可自动化部分) | health、/app/、test_api 有记录 | ✅ |
| T6 | `deploy-frontend.sh` prune 失败即中止 | 脚本 dry-run 后非 0 退出 | ✅ |
| T7 | `docs/changelog/2026-06-01-single-owner-execution.md` | 行数≥10,含验证命令 | ✅ |
## T5 验收子项
1. `/health` 纯文本 `ok`
2. `/app/` HTTP 200
3. 生产 `tests/test_api.py`(若环境允许)
4. 记录 Redis/MySQL/WebSSH/告警/守护 — 能 SSH 检查的写结果,需 UI 的标「待用户抽测」
## 回滚
- T2`git reset --hard <prev>` + `supervisorctl restart nexus`
- T6:还原 `deploy/deploy-frontend.sh` 单文件
+27 -14
View File
@@ -1,8 +1,10 @@
# Nexus 项目交接文件 — Cursor 继续开发 # Nexus 项目交接文件 — Cursor 继续开发
> 生成时间: 2026-06-01 > 生成时间: 2026-06-012026-06-01 晚更新:单负责人收口)
> 当前分支: main (与 origin/main 同步) > 当前分支: main与 origin/main 同步,含 b8af1fc 单 Agent 规则)
> 最后 commit: 91d0d41 docs: 添加 .cursorrules 供 Cursor 接管 > 协作方式: **用户 ↔ 当前 Cursor Agent**(无虚拟部门/Skill 分派)
> 主前端: **Vue 3 + Vuetify SPA**`frontend/` → `web/app/`
> 生产: https://api.synaglobal.vip 已部署
--- ---
@@ -291,20 +293,31 @@ MCP deploy 工具自动执行门控,任何一门不过返回 🚫 DEPLOY BLOCK
--- ---
## 八、已知待续事项 ## 八、待续事项2026-06-01 更新)
### 已修复(见 `docs/changelog/2026-06-01-bug-remediation.md`
| 原优先级 | 问题 | 状态 |
|----------|------|------|
| P1 | ServersPage 批量 Agent 操作 | ✅ `normalizeServerIds` + 生产 SPA 已部署 |
| P1 | script-callback 无 API Key | ✅ `X-API-Key` 校验 |
| P1 | Access Token 30 天 | ✅ 60min + HttpOnly refresh |
| P2 | 未知 IP 心跳 422 刷屏 | ✅ 丢弃 + debug 日志 |
| P2 | Admin 废弃 JWT 列 | ✅ 迁移 DROP |
| P3 | agent on_event 弃用 | ✅ lifespan |
### 仍待办 / 抽测
| 优先级 | 问题 | 文件 | 说明 | | 优先级 | 问题 | 文件 | 说明 |
|--------|------|------|------| |--------|------|------|------|
| P1 | 批量操作按钮无反应 | ServersPage.vue | 服务器列表顶部「升级/安装/卸载 Agent」按钮,选中后点击没反应 | | P2 | 422 调试 handler 是否保留 | server/main.py | 若日志已稳定可改为仅 4xx 结构化响应 |
| P1 | agent script-callback 无 API Key 认证 | server/api/agent.py | 端点仅靠 job_id+secret 验证,无 API Key 校验 | | P2 | 壁纸旧端点缓存 | LoginPage.vue | 强刷 `/app/` 或清站点数据 |
| P1 | 访问令牌 30 天有效期过长 | server/config.py | 行业标准 15-60 分钟 + refresh token 轮换,当前 30 天 | | UX | 终端命令栏高亮对齐 | TerminalPage.vue | 多分辨率抽测 |
| P2 | 47.121.118.30 持续发 422 | server/api/agent.py | 该 IP 不在数据库但持续发心跳,需静默丢弃或注册 | | **验收** | 告警 Telegram + WS 端到端 | — | 需故意超阈值或模拟 |
| P2 | 422 调试日志是临时的 | server/main.py | RequestValidationError handler 仅用于调试,确认问题后应移除 | | **验收** | WebSSH 长会话 + resize | terminal | 浏览器抽测 |
| P2 | Admin 废弃列未清理 | server/domain/models/__init__.py | jwt_refresh_token/jwt_token_expires 旧单token设计遗留 | | **验收** | Sync 推送 2 台试跑 | push | 业务抽测 |
| P2 | 壁纸 URL 请求命中单数端点 | LoginPage.vue | 浏览器缓存旧 JS 时请求 `/bing-wallpaper` 而非 `/bing-wallpapers`,清缓存可解决 | | **验收** | 三层守护 kill 测试 | deploy/ | 维护窗口执行 |
| P3 | agent.py on_event 弃用 | server/api/agent.py | `on_event("startup")` 已弃用应改 lifespan | | **运维** | 生产 pytest | tests/test_api.py | 服务器无 pytest 模块时用 WSL/CI 25/25 为准 |
| P3 | Agent 心跳缺指数退避 | server/api/agent.py | 心跳失败时无退避策略 |
| UX | 命令输入栏高亮与输入框对齐 | TerminalPage.vue | cmd-highlight 定位可能在不同浏览器/分辨率下有偏差 |
--- ---
@@ -0,0 +1,27 @@
# 生产验收记录 — 2026-06-01
> 执行人:单 Agent(用户唯一对接)
> 计划:`docs/design/plans/2026-06-01-single-owner-execution.md`
## 自动化结果
| 项 | 命令/方式 | 结果 |
|----|-----------|------|
| Git 同步 | `git reset --hard origin/main` @ b8af1fc | ✅ |
| 后端重启 | `supervisorctl restart nexus` | ✅ RUNNING |
| `/health` | `curl http://127.0.0.1:8600/health` | ✅ `ok` |
| `/app/` | HTTP 状态码 | ✅ 200 |
| Redis | `redis-cli ping` | ✅ PONG |
| MySQL | `SELECT 1` | ✅ ok |
| `test_api.py` | 生产机 | ⚠️ 无 `pytest` 模块;以 WSL/本地 CI 为准 |
## 待用户/维护窗口抽测
- [ ] WebSocket 告警 + Telegram 推送与恢复
- [ ] WebSSH 开终端、resize、断线
- [ ] Push/Sync 选 2 台试跑
- [ ] kill Python → Supervisor 恢复;health_monitor 连续失败重启
## 备注
前端构建物不在 git;生产 `web/app/assets` 以最近一次 tar/scp 为准。prune 须先 `--dry-run``deploy/deploy-frontend.sh` 已加固)。