docs: 固化资源包仓库权威预检
This commit is contained in:
@@ -68,6 +68,37 @@ Artificer 内部执行边界:
|
||||
- `unidesk-trans`、runner tools bundle、`unidesk-ssh` SecretRef 和 endpoint presence 必须同时存在;
|
||||
- Secret 值不得进入 prompt、task、日志或报告。
|
||||
|
||||
## 资源包仓库权威映射
|
||||
|
||||
- `config/agentrun.yaml` 的 lane 只声明:
|
||||
- `gitMirror.repositoryAuthorityConfigRef`;
|
||||
- `gitMirror.repositories[].authorityRef`;
|
||||
- 对应的 upstream repository、clone URL 和 branch identity。
|
||||
- 精确 Gitea `readUrl` 只归
|
||||
`config/platform-infra/gitea.yaml#sourceAuthority.repositories` 所有:
|
||||
- lane parser 必须按 `authorityRef` 精确命中一次;
|
||||
- target、upstream repository、clone URL 和 source branch 必须一致;
|
||||
- 零匹配、多匹配或 identity 漂移必须在渲染前 fail closed。
|
||||
- renderer 只把已解析的 repository 到 Gitea `readUrl` 映射注入
|
||||
`AGENTRUN_RESOURCE_BUNDLE_REPOSITORIES_JSON`:
|
||||
- 禁止注入 base URL 后在 manager 或 runner 中拼接 GitHub owner/repo;
|
||||
- GitHub repository 必须精确命中一次,缺失或重复时返回
|
||||
`infra-failed`,不得回退 GitHub 或 legacy git-mirror;
|
||||
- 非 GitHub URL 继续使用 bundle 自身声明的 URL,不做迁移改写。
|
||||
- 合并或发布前只执行一次 YAML-first 预检:
|
||||
|
||||
```bash
|
||||
bun scripts/cli.ts agentrun control-plane plan --node <NODE> --lane <lane-id>
|
||||
```
|
||||
|
||||
- 预检必须一次披露:
|
||||
- repository authority `configRef` 与内容 SHA-256;
|
||||
- 每个 repository 的 `authorityRef`、repository identity 与精确 `readUrl`;
|
||||
- 缺失、重复或 identity 漂移的具体配置路径。
|
||||
- 发布后只用全新 Artificer session 验收,确认
|
||||
`resource-bundle-materialized.repositoryAuthority` 与该次 fetch 一致;
|
||||
禁止复用迁移前已经失败的 session 作为新代码证据。
|
||||
|
||||
`agentrun events` 是高频渐进披露入口:
|
||||
|
||||
- 短只读 canary 使用固定三步闭环:
|
||||
|
||||
@@ -207,6 +207,15 @@ export function renderAgentRunControlPlanePlanSummary(result: Record<string, unk
|
||||
const node = record(target.node);
|
||||
const runtime = record(target.runtime);
|
||||
const source = record(target.source);
|
||||
const gitMirror = record(target.gitMirror);
|
||||
const repositoryAuthority = record(gitMirror.repositoryAuthority);
|
||||
const repositories = Array.isArray(gitMirror.repositories) ? gitMirror.repositories.map(record) : [];
|
||||
const repositoryRows = repositories.slice(0, 12).map((repository) => [
|
||||
displayValue(repository.authorityRef),
|
||||
displayValue(repository.repository),
|
||||
displayValue(repository.sourceBranch),
|
||||
displayValue(repository.readUrl),
|
||||
]);
|
||||
const checks = Array.isArray(result.plannedChecks) ? result.plannedChecks.map(String) : [];
|
||||
const lines = [
|
||||
"AGENTRUN CONTROL-PLANE PLAN",
|
||||
@@ -225,12 +234,22 @@ export function renderAgentRunControlPlanePlanSummary(result: Record<string, unk
|
||||
"CHECKS",
|
||||
...(checks.length === 0 ? ["-"] : checks.slice(0, 12).map((check) => `- ${check}`)),
|
||||
"",
|
||||
"RESOURCE BUNDLE REPOSITORIES",
|
||||
` authority: ${displayValue(repositoryAuthority.configRef ?? "-")}`,
|
||||
` sha256: ${displayValue(repositoryAuthority.sha256 ?? "-")}`,
|
||||
repositoryRows.length === 0
|
||||
? "-"
|
||||
: renderTable(["AUTHORITY_REF", "REPOSITORY", "BRANCH", "READ_URL"], repositoryRows),
|
||||
repositories.length > repositoryRows.length
|
||||
? ` omitted=${repositories.length - repositoryRows.length}; use --full for all repositories`
|
||||
: null,
|
||||
"",
|
||||
"NEXT",
|
||||
...renderNextObjectLines(record(result.next)),
|
||||
"",
|
||||
"DETAIL",
|
||||
" use --full for rendered target details; valuesPrinted=false",
|
||||
];
|
||||
].filter((line): line is string => line !== null);
|
||||
return renderedCliResult(result.ok !== false, "agentrun control-plane plan", `${lines.join("\n")}\n`);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user