feat: integrate platform backend and application interfaces

This commit is contained in:
Qiufeng
2026-09-02 21:09:47 +08:00
parent cd9ac1af70
commit b16390dd41
648 changed files with 102488 additions and 17737 deletions
@@ -0,0 +1,370 @@
{
"schema_version": 1,
"diagram_type": "workflow",
"meta": {
"title": "元境幻生渠道、模型与智能调度目标逻辑",
"locale": "zh-CN",
"output": "docs/miragenflow-channel-model-logic.html",
"animation": "none",
"visual_preset": "blueprint",
"quality_profile": "showcase",
"viewBox": [930, 590],
"legend": {
"mode": "all",
"entries": {
"frontend": { "label": "管理页面" },
"backend": { "label": "目录与调度" },
"messagebus": { "label": "队列与切换" },
"security": { "label": "状态与治理" },
"external": { "label": "用户与供应商" }
}
},
"views": [
{
"id": "page-responsibilities",
"label": "页面职责",
"focus": ["channel-page", "discovery", "model-page", "group-page", "governance-page"],
"note": "四类管理职责分开,模型发现只提供候选,不再承载无关新增表单。"
},
{
"id": "model-routing",
"label": "模型与路由",
"focus": ["discovery", "model-page", "group-page", "route-policy", "scheduler"],
"note": "公开模型目录与渠道路由池分离,分组内保存明确的渠道优先级。"
},
{
"id": "smart-routing",
"label": "智能调度",
"focus": ["user-task", "scheduler", "queue-node", "worker", "provider"],
"note": "用户只选择公开模型,系统按资格、优先级、健康和负载选择实际渠道。"
},
{
"id": "failure-governance",
"label": "失败与对账",
"focus": ["worker", "fallback", "unknown-result", "reconcile", "governance-page"],
"note": "确认失败才切换,供应商结果未知时暂停结算并进入人工对账。"
}
]
},
"lanes": [
{ "id": "admin", "label": "管理页面" },
{ "id": "catalog", "label": "目录与路由配置" },
{ "id": "runtime", "label": "任务运行时" },
{ "id": "exception", "label": "失败与治理", "variant": "exception" }
],
"groups": [
{ "id": "catalog-boundary", "label": "目录边界", "lane": "catalog", "fromCol": 0, "toCol": 2, "variant": "emphasis" },
{ "id": "routing-boundary", "label": "路由输入", "lane": "catalog", "fromCol": 3, "toCol": 5, "variant": "dashed" },
{ "id": "recovery-boundary", "label": "需要人工判断的异常", "lane": "exception", "fromCol": 2, "toCol": 5, "variant": "security" }
],
"mainPath": ["user-task", "scheduler", "queue-node", "worker", "provider"],
"nodes": [
{
"id": "channel-page",
"lane": "admin",
"col": 0,
"type": "frontend",
"label": "渠道管理",
"sublabel": "地址 · 凭证 · 拉取",
"tag": "现有职责",
"width": 96
},
{
"id": "model-page",
"lane": "admin",
"col": 1,
"type": "frontend",
"label": "模型管理",
"sublabel": "目录 · 参数 · 上架",
"tag": "不手填渠道",
"width": 96
},
{
"id": "group-page",
"lane": "admin",
"col": 3,
"type": "frontend",
"label": "分组管理",
"sublabel": "模型 × 渠道 × 顺序",
"tag": "建立路由池",
"width": 96
},
{
"id": "governance-page",
"lane": "admin",
"col": 5,
"type": "frontend",
"label": "运行治理",
"sublabel": "健康 · 任务 · 审计",
"tag": "独立页面",
"width": 110
},
{
"id": "discovery",
"lane": "catalog",
"col": 0,
"type": "backend",
"label": "模型发现",
"sublabel": "上游列表 → 候选",
"tag": "不自动创建",
"width": 96
},
{
"id": "catalog-node",
"lane": "catalog",
"col": 2,
"type": "backend",
"label": "公开模型目录",
"sublabel": "公开 ID · 能力 · 分辨率",
"tag": "人工上架",
"width": 110
},
{
"id": "route-policy",
"lane": "catalog",
"col": 3,
"type": "backend",
"label": "路由策略",
"sublabel": "资格 · 优先级 · 版本",
"tag": "调度输入",
"width": 96
},
{
"id": "provider",
"lane": "catalog",
"col": 5,
"type": "external",
"label": "上游供应商",
"sublabel": "公开 ID ≠ 请求 ID",
"tag": "外部接口",
"width": 110
},
{
"id": "user-task",
"lane": "runtime",
"col": 0,
"type": "external",
"label": "用户任务",
"sublabel": "选择公开模型",
"tag": "不暴露供应商",
"width": 96
},
{
"id": "scheduler",
"lane": "runtime",
"col": 2,
"type": "backend",
"label": "智能调度",
"sublabel": "过滤 · 排序 · 选路",
"tag": "保存策略快照",
"width": 110
},
{
"id": "queue-node",
"lane": "runtime",
"col": 3,
"type": "messagebus",
"label": "任务队列",
"sublabel": "幂等入队 · 租约",
"tag": "异步",
"width": 86
},
{
"id": "worker",
"lane": "runtime",
"col": 5,
"type": "backend",
"label": "任务执行",
"sublabel": "尝试 · 结果 · 结算",
"tag": "记录每次调用",
"width": 106
},
{
"id": "fallback",
"lane": "exception",
"col": 2,
"type": "messagebus",
"label": "故障切换",
"sublabel": "下一候选渠道",
"width": 72
},
{
"id": "unknown-result",
"lane": "exception",
"col": 3,
"type": "security",
"label": "未知结果",
"sublabel": "暂停结算与重试",
"width": 60
},
{
"id": "reconcile",
"lane": "exception",
"col": 5,
"type": "frontend",
"label": "人工对账",
"sublabel": "确认成功或失败",
"tag": "恢复闭环",
"width": 100
}
],
"edges": [
{
"id": "channel-discovery",
"from": "channel-page",
"to": "discovery",
"label": "主动拉取",
"variant": "emphasis",
"route": "drop",
"fromSide": "bottom",
"toSide": "top",
"labelAt": [150, 166]
},
{
"id": "discovery-model",
"from": "discovery",
"to": "model-page",
"variant": "emphasis"
},
{
"id": "catalog-model",
"from": "model-page",
"to": "catalog-node",
"label": "维护公开参数",
"variant": "emphasis",
"route": "drop",
"fromSide": "bottom",
"toSide": "top",
"labelAt": [320, 166]
},
{
"id": "model-group",
"from": "model-page",
"to": "group-page"
},
{
"id": "group-route",
"from": "group-page",
"to": "route-policy",
"variant": "emphasis",
"route": "drop",
"fromSide": "bottom",
"toSide": "top"
},
{
"id": "governance-route",
"from": "governance-page",
"to": "route-policy",
"label": "健康进入策略",
"variant": "dashed",
"route": "drop",
"fromSide": "bottom",
"toSide": "top",
"bias": 0.5,
"labelAt": [530, 166]
},
{
"id": "route-scheduler",
"from": "route-policy",
"to": "scheduler",
"label": "发布策略版本",
"variant": "emphasis",
"route": "drop",
"fromSide": "bottom",
"toSide": "top",
"labelAt": [365, 290]
},
{
"id": "submit-task",
"from": "user-task",
"to": "scheduler",
"label": "公开模型 + 参数",
"variant": "emphasis"
},
{
"id": "schedule-queue",
"from": "scheduler",
"to": "queue-node",
"variant": "emphasis",
"route": "straight",
"fromSide": "right",
"toSide": "left"
},
{
"id": "queue-worker",
"from": "queue-node",
"to": "worker",
"label": "租约执行",
"role": "async",
"labelAt": [525, 367]
},
{
"id": "call-provider",
"from": "worker",
"to": "provider",
"variant": "emphasis"
},
{
"id": "provider-result",
"from": "provider",
"to": "worker",
"variant": "dashed",
"role": "return",
"route": "outside-right",
"fromSide": "right",
"toSide": "right",
"channelX": 740
},
{
"id": "retryable-failure",
"from": "worker",
"to": "fallback",
"variant": "security",
"role": "error",
"route": "drop",
"fromSide": "bottom",
"toSide": "top"
},
{
"id": "next-candidate",
"from": "fallback",
"to": "scheduler",
"variant": "dashed",
"role": "return",
"route": "straight",
"fromSide": "top",
"toSide": "bottom"
},
{
"id": "unknown-provider-result",
"from": "provider",
"to": "unknown-result",
"variant": "security",
"role": "error",
"via": [[760, 243], [760, 540], [430, 540]],
"fromSide": "right",
"toSide": "bottom",
"labelAt": [760, 540]
},
{
"id": "manual-reconcile",
"from": "unknown-result",
"to": "reconcile",
"label": "人工确认",
"variant": "security",
"role": "error"
}
],
"cards": [
{
"dot": "cyan",
"title": "职责分层:渠道 / 模型 / 分组 / 套餐",
"items": []
},
{
"dot": "emerald",
"title": "调度闭环:过滤 / 优先级 / 健康 / 对账",
"items": []
}
]
}