Repository navigation
feat(m10): 评测模板机器触发:候选 commit 注入与服务令牌 (#429) - #431
Merged
Merged
Conversation
This was referenced Nov 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
实现 issue #429:评测模板支持机器触发——launch 可携带可选
asset_override(代码仓 + 候选 commit + 资产选择)把评测钉在指定 commit,并新增服务令牌作为机器身份。资产解析、快照冻结与 prepare/create 链路全部复用既有实现;控制台一键启动的输入、返回、权限与幂等语义不变。service_token表与迁移0035_service_token;POST/GET/DELETE /api/v1/service-tokens(仅管理员会话);明文仅在创建响应返回一次,库内只存 SHA-256,列表只回显元数据eval:launch服务令牌;支持模板白名单、并发上限与当日预算上限;机器启动的created_by落svc:<name>,幂等键按该主体隔离LaunchTemplateRequest新增可选asset_override(repo_url/ref/commit/asset_paths/asset_types,整字段替换、缺省继承模板)与lineage;commit 为权威身份并断言resolved_commit一致asset与可能的warnings;status/results 新增asset,results 回显lineageeval:read服务令牌;compare/用例测试保持会话鉴权candidate_commit_mismatch、asset_source_unresolved、asset_ref_unresolved;复用asset_selection_empty、asset_path_not_found,任一命中都不创建评测docs/design/eval-platform-architecture.md§5.14 与表 2(中英镜像,预算 13500 → 13800)接口变更摘要
错误信封沿用既有
{"error": {"code", "message", "request_id", ...}};candidate_commit_mismatch / asset_source_unresolved / asset_ref_unresolved为 422,命中即不创建 run。实现要点
build_preparation/consume_preparation。覆盖只影响资产来源,不新增执行路径。resolved_commit == commit,不一致 422candidate_commit_mismatch;ref只做展示与审计(原样回显),不会参与解析(新增用例证明 provider 只收到 commit)。仅给 ref/commit 无法解析时 422asset_ref_unresolved;凭据失效/仓库不可达同映射。asset_override: {}(或仅显式 null)没有任何意图,按“未提供覆盖”处理,不要求模板绑定资产源、不输出asset块。unauthenticated(与平台既有会话语义一致);令牌 scope 不足或模板不在白名单 → 403forbidden。issue 验收里的“无令牌 → 403”按此口径落地为 401,已在检视记录中说明。asset(含既有模板启动与 run 级资产评测);这是增量字段,旧 run 不因缺少该字段而改变其他行为。last_used_at最多每 60 秒刷新一次,避免状态轮询把读请求变成每次写库。冒烟测试(真实候选 commit)
在本机启动真实后端(SQLite + 本地 S3 桩)与控制台,对公开仓库
Shadow-Azure/ai-eval-platform的真实 commita82a590ade533b9ce8cc46f9be250e1a726da2d3做覆盖启动;14 项 API/UI 断言全部通过:asset.resolved_commit逐字等于请求 commitrequested_ref原样回显(commit 权威、ref 仅展示)created=false)eval_run.created_by=svc:hev-smoke-…,详情页可见skills/pr-review/SKILL.mdsha256 = 仓库该 commit 文件 sha256 (6512b872…)asset_source_unresolved,不建 runasset_ref_unresolved,不建 runeval:read的令牌启动 → 403forbiddenunauthenticated;撤销后 → 401冒烟报告(HTML)与全部截图见本地
reports/2026-11-25/m10-429-machine-trigger/;截图同时作为 release 资产:https://github.com/Shadow-Azure/ai-eval-platform/releases/tag/m10-429-machine-trigger-evidence-20261125。不提交代码仓。控制台(本次无前端改动,回归验证)
与原型对比(同视口 1600×1200 @2x)
01-app-template-list.png04-prototype-template-list.png02-app-template-detail.png05-prototype-template-detail.png03-app-eval-detail.png06-prototype-eval-detail.png结论:三类页面的信息架构、卡片分组、表格列与操作区与原型一致;差异仅为本地数据量、以及既有实现中的字段对齐方式/停用按钮可见性(均非 #429 引入,
web/不在本 issue scope)。原型截图:本地验证
门禁(CI,PR #431)
检视与已知口径
plans/2026-11-25-m10-candidate-launch-override/pr431-review.md(含逐文件分析与讨论点)。web/不在本 issue scope 且与原型一致,留待后续 UI issue。