candidate.json.bak 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  1. {
  2. "schema_version": 1,
  3. "diagram_type": "architecture",
  4. "meta": {
  5. "title": "恪澜通 · 运营支撑系统(klt-bos)架构总览",
  6. "output": ".archify/architecture-klt-bos-20261116-135235/klt-bos-architecture.html",
  7. "locale": "zh-CN",
  8. "quality_profile": "showcase",
  9. "repository": {
  10. "url": "http://112.124.19.38:8080/klt-bos/klt-bos-service.git",
  11. "revision": "8013f40416d3200056a828edb6846287bb4a9838",
  12. "link_mode": "local-only"
  13. }
  14. },
  15. "components": [
  16. {
  17. "id": "browser",
  18. "type": "external",
  19. "label": "浏览器 / 前端原型",
  20. "sublabel": "10 类角色 · 47 条路由",
  21. "pos": [30, 300],
  22. "size": [130, 66],
  23. "sources": [
  24. { "path": "README.md", "line": 53, "end_line": 59 }
  25. ]
  26. },
  27. {
  28. "id": "idp",
  29. "type": "security",
  30. "label": "身份提供方 / 令牌",
  31. "sublabel": "identity-provider · JWKS",
  32. "pos": [240, 90],
  33. "size": [150, 60],
  34. "sources": [
  35. { "path": "src/bin/klt-bos/src/main.rs", "line": 273, "end_line": 289 },
  36. { "path": "src/config/prod.toml", "line": 80, "end_line": 83 }
  37. ]
  38. },
  39. {
  40. "id": "gateway",
  41. "type": "cloud",
  42. "label": "SEOH API 网关",
  43. "sublabel": "/api/klt/bos/**@v1",
  44. "pos": [240, 300],
  45. "size": [150, 66],
  46. "sources": [
  47. { "path": "src/README.md", "line": 18, "end_line": 18 },
  48. { "path": "src/config/default.toml", "line": 32, "end_line": 49 }
  49. ]
  50. },
  51. {
  52. "id": "ac",
  53. "type": "security",
  54. "label": "访问控制 AC",
  55. "sublabel": "权限键判权 · 上界注入",
  56. "pos": [240, 190],
  57. "size": [150, 60],
  58. "sources": [
  59. { "path": "docs/详细设计说明书/00-总则与全局约定/04-模块划分与请求链路.md", "line": 46, "end_line": 50 }
  60. ]
  61. },
  62. {
  63. "id": "bootstrap",
  64. "type": "backend",
  65. "label": "服务装配 bin/klt-bos",
  66. "sublabel": "注册 · 心跳 · TLS · 配置",
  67. "pos": [450, 500],
  68. "size": [150, 70],
  69. "sources": [
  70. { "path": "src/bin/klt-bos/src/main.rs", "line": 26, "end_line": 31 },
  71. { "path": "src/bin/klt-bos/src/main.rs", "line": 444, "end_line": 479 }
  72. ]
  73. },
  74. {
  75. "id": "api",
  76. "type": "frontend",
  77. "label": "bos-api 路由与中间件",
  78. "sublabel": "Axum · AuthContext",
  79. "pos": [450, 300],
  80. "size": [150, 66],
  81. "sources": [
  82. { "path": "src/crates/bos-api/src/lib.rs", "line": 1, "end_line": 14 },
  83. { "path": "src/bin/klt-bos/src/main.rs", "line": 330, "end_line": 360 }
  84. ]
  85. },
  86. {
  87. "id": "modules",
  88. "type": "backend",
  89. "label": "业务模块",
  90. "sublabel": "account · ops · billing",
  91. "pos": [670, 240],
  92. "size": [170, 84],
  93. "sources": [
  94. { "path": "docs/详细设计说明书/00-总则与全局约定/04-模块划分与请求链路.md", "line": 23, "end_line": 27 },
  95. { "path": "src/modules/account/src/router.rs", "line": 13, "end_line": 20 }
  96. ]
  97. },
  98. {
  99. "id": "support",
  100. "type": "backend",
  101. "label": "支撑库",
  102. "sublabel": "scope · invariant · activation · io · jobs",
  103. "pos": [670, 420],
  104. "size": [170, 84],
  105. "sources": [
  106. { "path": "docs/详细设计说明书/00-总则与全局约定/04-模块划分与请求链路.md", "line": 18, "end_line": 22 }
  107. ]
  108. },
  109. {
  110. "id": "core",
  111. "type": "backend",
  112. "label": "bos-core 基础库",
  113. "sublabel": "ID · 金额 · 日期 · 错误码",
  114. "pos": [670, 560],
  115. "size": [170, 60],
  116. "sources": [
  117. { "path": "docs/详细设计说明书/00-总则与全局约定/04-模块划分与请求链路.md", "line": 7, "end_line": 8 }
  118. ]
  119. },
  120. {
  121. "id": "platform_client",
  122. "type": "backend",
  123. "label": "bos-platform 平台客户端",
  124. "sublabel": "UDS · IAM · 调度 · OSS",
  125. "pos": [890, 330],
  126. "size": [180, 84],
  127. "sources": [
  128. { "path": "src/crates/bos-platform/src/lib.rs", "line": 1, "end_line": 10 },
  129. { "path": "src/crates/bos-platform/src/clients/mod.rs", "line": 1, "end_line": 9 }
  130. ]
  131. },
  132. {
  133. "id": "uds",
  134. "type": "database",
  135. "label": "UDS 数据网关",
  136. "sublabel": "数据面 · query/dml",
  137. "pos": [1120, 260],
  138. "size": [160, 70],
  139. "sources": [
  140. { "path": "src/crates/bos-api/src/state.rs", "line": 5, "end_line": 10 },
  141. { "path": "src/crates/bos-platform/src/clients/uds.rs", "line": 212, "end_line": 231 }
  142. ]
  143. },
  144. {
  145. "id": "envdb",
  146. "type": "database",
  147. "label": "项目环境库",
  148. "sublabel": "project_{id}_{env}",
  149. "pos": [1360, 120],
  150. "size": [160, 70],
  151. "sources": [
  152. { "path": "docs/详细设计说明书/00-总则与全局约定/04-模块划分与请求链路.md", "line": 31, "end_line": 33 }
  153. ]
  154. },
  155. {
  156. "id": "iam_tree",
  157. "type": "security",
  158. "label": "IAM + 资源树",
  159. "sublabel": "身份 · 组树 · region/customer",
  160. "pos": [1120, 120],
  161. "size": [160, 70],
  162. "sources": [
  163. { "path": "docs/详细设计说明书/00-总则与全局约定/03-系统边界与职责切分.md", "line": 8, "end_line": 17 }
  164. ]
  165. },
  166. {
  167. "id": "sched_ets",
  168. "type": "messagebus",
  169. "label": "SJC + ETS",
  170. "sublabel": "调度 · 事件 · 延时任务",
  171. "pos": [1360, 300],
  172. "size": [160, 76],
  173. "sources": [
  174. { "path": "docs/详细设计说明书/00-总则与全局约定/03-系统边界与职责切分.md", "line": 33, "end_line": 34 }
  175. ]
  176. },
  177. {
  178. "id": "oss_imp",
  179. "type": "cloud",
  180. "label": "导入导出 / OSS",
  181. "sublabel": "异步通道 · 对象存储",
  182. "pos": [1360, 480],
  183. "size": [160, 76],
  184. "sources": [
  185. { "path": "docs/详细设计说明书/00-总则与全局约定/03-系统边界与职责切分.md", "line": 35, "end_line": 38 },
  186. { "path": "src/crates/bos-io/src/lib.rs", "line": 1, "end_line": 9 }
  187. ]
  188. },
  189. {
  190. "id": "reg_cfg",
  191. "type": "cloud",
  192. "label": "注册 / 配置中心",
  193. "sublabel": "G1 注册 · 心跳 · 连接键",
  194. "pos": [1120, 500],
  195. "size": [160, 70],
  196. "sources": [
  197. { "path": "src/config/default.toml", "line": 44, "end_line": 49 },
  198. { "path": "src/config/default.toml", "line": 57, "end_line": 65 }
  199. ]
  200. },
  201. {
  202. "id": "operator",
  203. "type": "external",
  204. "label": "运营商 / 网管侧",
  205. "sublabel": "开通执行 · 结果回填",
  206. "pos": [1560, 600],
  207. "size": [150, 66],
  208. "sources": [
  209. { "path": "README.md", "line": 7, "end_line": 13 }
  210. ]
  211. }
  212. ],
  213. "boundaries": [
  214. {
  215. "kind": "region",
  216. "label": "SEOH 身份与接入判权",
  217. "wraps": ["idp", "gateway", "ac"],
  218. "pad": 16
  219. },
  220. {
  221. "kind": "region",
  222. "label": "klt-bos 扩展微服务 · Rust / Axum 单进程",
  223. "wraps": ["bootstrap", "api", "modules", "support", "core", "platform_client"],
  224. "pad": 18
  225. },
  226. {
  227. "kind": "region",
  228. "label": "SEOH 数智能力中台",
  229. "wraps": ["uds", "envdb", "iam_tree", "sched_ets", "oss_imp", "reg_cfg"],
  230. "pad": 16
  231. }
  232. ],
  233. "connections": [
  234. {
  235. "id": "browser-gateway",
  236. "from": "browser",
  237. "to": "gateway",
  238. "label": "HTTPS · 用户 JWT",
  239. "variant": "emphasis"
  240. },
  241. {
  242. "id": "browser-idp",
  243. "from": "browser",
  244. "to": "idp",
  245. "label": "登录 · 签发 JWT",
  246. "variant": "security"
  247. },
  248. {
  249. "id": "gateway-ac",
  250. "from": "gateway",
  251. "to": "ac",
  252. "label": "权限键判权 · 回注上界",
  253. "variant": "security"
  254. },
  255. {
  256. "id": "gateway-api",
  257. "from": "gateway",
  258. "to": "api",
  259. "label": "转发(判权通过)",
  260. "variant": "emphasis"
  261. },
  262. {
  263. "id": "bootstrap-api",
  264. "from": "bootstrap",
  265. "to": "api",
  266. "label": "装配路由 · 注册心跳",
  267. "variant": "dashed"
  268. },
  269. {
  270. "id": "api-modules",
  271. "from": "api",
  272. "to": "modules",
  273. "label": "路由分发 · AuthContext"
  274. },
  275. {
  276. "id": "modules-support",
  277. "from": "modules",
  278. "to": "support",
  279. "label": "范围 · 不变量 · 激活 · 作业"
  280. },
  281. {
  282. "id": "support-core",
  283. "from": "support",
  284. "to": "core",
  285. "label": "基础能力"
  286. },
  287. {
  288. "id": "modules-platform",
  289. "from": "modules",
  290. "to": "platform_client",
  291. "label": "平台调用"
  292. },
  293. {
  294. "id": "support-platform",
  295. "from": "support",
  296. "to": "platform_client",
  297. "label": "导入导出 · 作业",
  298. "variant": "dashed"
  299. },
  300. {
  301. "id": "platform-uds",
  302. "from": "platform_client",
  303. "to": "uds",
  304. "label": "数据面 · SQL/DML",
  305. "variant": "emphasis"
  306. },
  307. {
  308. "id": "platform-iam",
  309. "from": "platform_client",
  310. "to": "iam_tree",
  311. "label": "IAM · 资源树读写"
  312. },
  313. {
  314. "id": "platform-sched",
  315. "from": "platform_client",
  316. "to": "sched_ets",
  317. "label": "作业 / 事件登记",
  318. "variant": "dashed"
  319. },
  320. {
  321. "id": "platform-oss",
  322. "from": "platform_client",
  323. "to": "oss_imp",
  324. "label": "异步通道 · OSS",
  325. "variant": "dashed"
  326. },
  327. {
  328. "id": "bootstrap-registry",
  329. "from": "bootstrap",
  330. "to": "reg_cfg",
  331. "label": "注册 · 心跳 · 读连接键",
  332. "variant": "dashed"
  333. },
  334. {
  335. "id": "uds-envdb",
  336. "from": "uds",
  337. "to": "envdb",
  338. "label": "读写(经 UDS)"
  339. },
  340. {
  341. "id": "operator-sched",
  342. "from": "operator",
  343. "to": "sched_ets",
  344. "label": "开通结果 · 回填事件",
  345. "variant": "dashed"
  346. }
  347. ],
  348. "cards": [
  349. {
  350. "dot": "cyan",
  351. "title": "判权与请求链路",
  352. "items": [
  353. "网关按 OpenAPI x-resource-type / x-action / x-version 拼权限键判权并回注实例上界",
  354. "klt-bos 作为 HTTP 宿主只做服务侧角色判定,原样转发最终用户 JWT 写资源树",
  355. "平台审计与业务审计双写,两份数据不可互替"
  356. ]
  357. },
  358. {
  359. "dot": "violet",
  360. "title": "模块与依赖方向",
  361. "items": [
  362. "编译期强制 modules/* → scope / invariant / activation → platform → core",
  363. "六个支撑模块不得反向 import 任何业务模块,否则范围收口与不变量可被绕过",
  364. "account、ops 已交付主体;billing 主体在详细设计第 6 册"
  365. ]
  366. },
  367. {
  368. "dot": "emerald",
  369. "title": "数据面与平台边界",
  370. "items": [
  371. "无自有数据库连接池,全部读写经 UDS 网关落到 project_{id}_{env}",
  372. "不自建继承、判权中间层、调度流水与审计通道等第二真源",
  373. "签名模式用 JCS 字节 + keypair 六头,⛔ 与 Bearer 同现"
  374. ]
  375. },
  376. {
  377. "dot": "slate",
  378. "title": "系统与外部边界",
  379. "items": [
  380. "不算支付、不开发票、不记录真实资金到账",
  381. "开停由网络管理侧执行,BOS 只生成待执行记录与对账依据并接收开通结果",
  382. "店铺运营与 AI 业务不在本系统范围内"
  383. ]
  384. }
  385. ]
  386. }