From 759af7c6d994114e2c3eee1045d9d51df608fc93 Mon Sep 17 00:00:00 2001 From: pikastech Date: Wed, 22 Jul 2026 01:07:49 +0200 Subject: [PATCH] =?UTF-8?q?docs:=20=E5=9B=BA=E5=8C=96=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E5=8C=85=E4=BB=93=E5=BA=93=E6=9D=83=E5=A8=81=E9=A2=84=E6=A3=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../unidesk-agentrun/references/resources.md | 31 +++++++++++++++++++ scripts/src/agentrun/public-exposure.ts | 21 ++++++++++++- 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/.agents/skills/unidesk-agentrun/references/resources.md b/.agents/skills/unidesk-agentrun/references/resources.md index f8cbf44a..c04fb79a 100644 --- a/.agents/skills/unidesk-agentrun/references/resources.md +++ b/.agents/skills/unidesk-agentrun/references/resources.md @@ -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 --lane +``` + +- 预检必须一次披露: + - repository authority `configRef` 与内容 SHA-256; + - 每个 repository 的 `authorityRef`、repository identity 与精确 `readUrl`; + - 缺失、重复或 identity 漂移的具体配置路径。 +- 发布后只用全新 Artificer session 验收,确认 + `resource-bundle-materialized.repositoryAuthority` 与该次 fetch 一致; + 禁止复用迁移前已经失败的 session 作为新代码证据。 + `agentrun events` 是高频渐进披露入口: - 短只读 canary 使用固定三步闭环: diff --git a/scripts/src/agentrun/public-exposure.ts b/scripts/src/agentrun/public-exposure.ts index 8877bfad..a929b4b6 100644 --- a/scripts/src/agentrun/public-exposure.ts +++ b/scripts/src/agentrun/public-exposure.ts @@ -207,6 +207,15 @@ export function renderAgentRunControlPlanePlanSummary(result: Record [ + 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 `- ${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`); }