{
  "module": "dev_spec",
  "version": "1.0",
  "purpose": "Dashboard 'G 规范' tab 展示开发规范 (dev-spec.md) 内容，供开发人员查阅系统架构、编码规范、部署流程等约束。",
  "ui_location": "Principles 菜单 → G 规范 tab",

  "human_help": {
    "title": "G 规范 — 开发规范",
    "description": [
      "本 tab 展示 dev-spec.md（开发规范文档）的完整内容，包含系统架构、开发约束、上线流程、编码规范等。",
      "文档本身通过 git 版本管理，历史版本可通过下方的「历史版本」折叠区查看。",
      "修改 dev-spec.md 后需 commit & push，dashboard 自动读取最新版本。"
    ],
    "usage": [
      "1. 查看当前开发规范和约束",
      "2. 点击「历史版本」折叠区查看 git commit 历史",
      "3. 如需修改：编辑 docs/dev-spec.md → git commit → git push → 刷新本页"
    ],
    "related": "H 需求 tab 展示产品需求文档 (PRD.md)，G+H 构成双轨规范体系"
  },

  "ai_spec": {
    "apis": [
      {"method": "GET", "path": "/api/spec", "returns": "{ok, content, path} — dev-spec.md 全文"},
      {"method": "GET", "path": "/api/spec/history", "returns": "{ok, count, log} — git log 条目"}
    ],
    "dependencies": [
      "docs/dev-spec.md 文件必须存在且在 git 跟踪中",
      "git 历史依赖 git log 命令可用"
    ],
    "constraints": [
      "文档展示在子 tab 中，通过 fill('spec', html) 渲染",
      "内容通过内置 mdRender() 函数转换 Markdown 到 HTML",
      "历史版本折叠区默认收起，不占用首屏空间"
    ],
    "tests": [
      {"id": "DS01", "name": "/api/spec 返回 dev-spec.md 内容", "endpoint": "GET /api/spec"},
      {"id": "DS02", "name": "/api/spec/history 返回 git log", "endpoint": "GET /api/spec/history"},
      {"id": "DS03", "name": "G tab 展示规范的 Markdown 渲染内容", "endpoint": "n/a (frontend check)"}
    ],
    "related_files": [
      "docs/dev-spec.md — 被展示的规范文档",
      "gateway/scripts/dashboard.py — /api/spec, /api/spec/history",
      "gateway/scripts/templates/dashboard.html — fS2() 渲染函数",
      "gateway/scripts/specs/dev_spec.json — 本 spec 文件"
    ]
  }
}
