Skip to content

Fix documentation drift and add missing operational runbooks#8

Open
study8677 wants to merge 1 commit into
Lling0000:mainfrom
study8677:docs/runbook-drift-and-day2-ops
Open

Fix documentation drift and add missing operational runbooks#8
study8677 wants to merge 1 commit into
Lling0000:mainfrom
study8677:docs/runbook-drift-and-day2-ops

Conversation

@study8677

Copy link
Copy Markdown

Summary

本 PR 只改文档,不改任何代码、配置或脚本。依据一轮针对 docs/runbooks/infra/.github/workflows/、实际代码的穷尽式一致性审计(24 个编号漂移点 DEP-0124 + 运维文档缺口 OPS-0107 + API 规范覆盖差异)。

修复确定漂移(docs/runbooks/deployment.md)

  • 环境变量名对齐实际代码:MODEL_PROVIDERUPSTREAM_MODEAUTH_SECRETBETTER_AUTH_SECRET,补 FIELD_ENCRYPTION_KEYAPI_KEY_PEPPER(见 apps/api/src/config.ts
  • 容器内 API 健康检查端口 30014000;防火墙移除清单同步
  • 公开健康检查路径 /health/health/live/health/ready
  • 备案前 SSH 隧道改为本地 8443 → 服务器 443,并补 --resolve 方式的 Host/SNI/证书验证命令
  • 防火墙清单补 443/udp(Caddy HTTP/3)
  • 补齐 data/postgresdata/redisdata/caddyconfig/caddy 四个 bind-mount 目录的创建、属主、权限与首次启动校验
  • 对"文档正确、实现有误"的阻断项(DEP-02 镜像变量合同、DEP-03 缺 migrate 镜像、DEP-04 env_file 解析)不迁就代码,插入"已知偏差"警示块,留待代码侧修复

修正事实错误(AGENTS.md)

  • Web 客户端 Phaser → 原生 Canvas 2D(仓库无 Phaser 依赖)
  • 删除不存在的 packages/ui 条目

补录已实现端点(docs/specs/api.md)

新增 7.0 节,补记 7 条代码已注册但规范未列的端点(health×2、auth/session、bootstrap、plots/:id/clear、payments/orders、payments/mock complete),标注沙箱/内部范围;未实现的正式合同保持原样、不降级。

新增四份运维 Runbook(docs/runbooks/)

  • operations.md:Day-2 日常运维(启停、巡检、日志、BullMQ/Outbox、Redis 丢失恢复、常见故障)
  • monitoring.md:SLI/SLO 与阈值;如实标注当前无 metrics/日志聚合设施及人工替代流程
  • incident-response.md:SEV 分级、响应时限、升级链、沟通与复盘模板
  • secrets-rotation.md:三个核心 Secret、数据库口令、TLS、SSH 的轮换与泄露处置

docs/README.md 索引同步更新。

验证

  • pnpm exec prettier --check(全部改动文件)通过
  • pnpm todo:check 通过
  • git diff 确认 README.md 与代码零改动

🤖 Generated with Claude Code

Correct deployment.md details (env var names, API port 3001→4000, SSH
tunnel target, health check paths, 443/udp firewall rule, bind-mount
setup) and flag known deviations for blocking issues DEP-02/03/04, fix
factual errors in AGENTS.md (Phaser→Canvas 2D, drop nonexistent
packages/ui), document 7 implemented-but-undocumented endpoints in
api.md, and add operations, monitoring, incident-response, and
secrets-rotation runbooks with an updated docs/README.md index.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@study8677 study8677 requested a review from Lling0000 as a code owner July 14, 2026 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant