feat(acceptance): 建立同构验收与弹性容量体系

实现本地三节点 K3s 同构环境、脱敏生产快照、Gemini 图片和多参考图视频协议模拟、统一验收报告及故障注入。\n\n新增 Worker 容量控制器、资源与连接预算、任务恢复保护,并将生产验收拆分为 validation 执行和人工 CAS 放量。\n\n验证包括 Go 全量测试、PostgreSQL HTTP 集成测试、go vet、OpenAPI、ShellCheck、前端检查、迁移及发布脚本测试。
This commit is contained in:
2026-07-31 18:02:24 +08:00
parent 93d36d0e55
commit e05922b0f4
94 changed files with 12379 additions and 826 deletions
@@ -0,0 +1,73 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://easyai.local/schemas/acceptance-report-v1.schema.json",
"title": "EasyAI acceptance-report/v1",
"type": "object",
"additionalProperties": false,
"required": ["schemaVersion", "runId", "release", "snapshot", "stages", "gates", "promotion", "createdAt", "secretSafe"],
"properties": {
"schemaVersion": {"const": "acceptance-report/v1"},
"runId": {"type": "string", "minLength": 1},
"release": {
"type": "object",
"additionalProperties": false,
"required": ["sourceSha", "apiImageDigest", "workerImageDigest"],
"properties": {
"sourceSha": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
"apiImageDigest": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"},
"workerImageDigest": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"}
}
},
"snapshot": {
"type": "object",
"additionalProperties": false,
"required": ["sourceReleaseSha", "configHash", "sha256"],
"properties": {
"sourceReleaseSha": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
"configHash": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
"sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
}
},
"stages": {
"type": "object",
"additionalProperties": {"$ref": "#/$defs/stage"}
},
"certifiedProfile": {"type": ["object", "null"]},
"gates": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": ["id", "passed"],
"properties": {
"id": {"type": "string", "minLength": 1},
"passed": {"type": "boolean"},
"detail": {"type": "string"}
}
}
},
"promotion": {
"type": "object",
"additionalProperties": false,
"required": ["ready", "requiresManualConfirmation", "trafficMode"],
"properties": {
"ready": {"type": "boolean"},
"requiresManualConfirmation": {"const": true},
"trafficMode": {"enum": ["validation", "live", "not-applicable"]},
"promotedAt": {"type": "string", "format": "date-time"}
}
},
"createdAt": {"type": "string", "format": "date-time"},
"secretSafe": {"const": true}
},
"$defs": {
"stage": {
"type": "object",
"additionalProperties": true,
"required": ["status"],
"properties": {
"status": {"enum": ["passed", "failed", "not-run"]}
}
}
}
}
@@ -0,0 +1,35 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://easyai.local/schemas/acceptance-snapshot-v1.schema.json",
"title": "EasyAI acceptance-snapshot/v1",
"type": "object",
"additionalProperties": false,
"required": ["schemaVersion", "source", "candidates", "snapshotSha256", "secretSafe"],
"properties": {
"schemaVersion": {"const": "acceptance-snapshot/v1"},
"source": {
"type": "object",
"additionalProperties": false,
"required": ["releaseSha", "configHash", "createdAt"],
"properties": {
"releaseSha": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
"configHash": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
"createdAt": {"type": "string", "format": "date-time"}
}
},
"candidates": {
"type": "array",
"minItems": 2,
"maxItems": 2,
"items": {
"type": "object",
"required": ["workload", "provider", "baseModel", "platform", "platformModel", "runtimePolicy", "pricingRules", "metadata"],
"properties": {
"workload": {"enum": ["gemini_image_edit", "multi_reference_video"]}
}
}
},
"snapshotSha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
"secretSafe": {"const": true}
}
}