fix(app-developer): 草稿来源原样使用 draftSource(1.0.1) (#232)

- 能力探测说明 authoring_capabilities 返回的 draftSource;app-draft.json 的 source 原样使用它,不填 runId、不自拟
- 客户端没有该字段时请用户提供会话 ID,或改在该 Agent 的默认会话继续,不猜值;不设客户端版本门槛
- read_draft / preview_prepare / development_enroll 因来源会话被拒时,按错误正文里的 draftSource 改正后重试
- authoring-api 参考补充 draftSource / draftSourceUnavailable 与三类来源拒绝错误码
- 版本 1.0.0 → 1.0.1,sidecar 与 i18n source_hash 同步;依赖 desirecore/desirecore#5419

验证:catalog metadata 与 i18n 校验 0 error,translate --check 通过;私有敏感词扫描未执行,经用户确认后合并。
This commit is contained in:
yige authored and GitHub committed 2026-10-29 08:27:30 +08:00
1 parent 5835ed8f14
commit 6371cb0268
4 files changed
+17 -15

No files matched your search

+9 -9
View File
@@ -4,7 +4,7 @@
"description": "用户要求开发、修改或发布自己的工作台应用,或把固定应用版本分发到 GitHub/Gitea 与 Registry 时使用。按所选技术栈使用的外部 Node/Docker 运行时、托管、Git 服务和数据库须有真实环境或连接及适用条款,可能另行部署或收费;缺能力时说明原因。", "description": "用户要求开发、修改或发布自己的工作台应用,或把固定应用版本分发到 GitHub/Gitea 与 Registry 时使用。按所选技术栈使用的外部 Node/Docker 运行时、托管、Git 服务和数据库须有真实环境或连接及适用条款,可能另行部署或收费;缺能力时说明原因。",
"license": "MIT", "license": "MIT",
"compatibility": "Requires DesireCore app-authoring-v1 capability handshake. Depending on the chosen stack, Node/Docker runtimes, hosting, GitHub/Gitea and databases require actual authorized environments or connections and applicable licensing/deployment terms; separate costs may apply. Unavailable capabilities stop the affected operation.", "compatibility": "Requires DesireCore app-authoring-v1 capability handshake. Depending on the chosen stack, Node/Docker runtimes, hosting, GitHub/Gitea and databases require actual authorized environments or connections and applicable licensing/deployment terms; separate costs may apply. Unavailable capabilities stop the affected operation.",
"version": "1.0.0", "version": "1.0.1",
"requiredClientVersion": "10.0.180", "requiredClientVersion": "10.0.180",
"type": "procedural", "type": "procedural",
"risk_level": "high", "risk_level": "high",
@@ -23,7 +23,7 @@
], ],
"metadata": { "metadata": {
"author": "desirecore", "author": "desirecore",
"updated_at": "2026-10-13", "updated_at": "2026-10-28",
"i18n": { "i18n": {
"default_locale": "en-US", "default_locale": "en-US",
"source_locale": "zh-CN", "source_locale": "zh-CN",
@@ -36,18 +36,18 @@
"short_desc": "开发个人工作台并发布到我的应用,按需分发固定版本", "short_desc": "开发个人工作台并发布到我的应用,按需分发固定版本",
"description": "用户要求开发、修改或发布自己的工作台应用,或把固定应用版本分发到 GitHub/Gitea 与 Registry 时使用。按所选技术栈使用的外部 Node/Docker 运行时、托管、Git 服务和数据库须有真实环境或连接及适用条款,可能另行部署或收费;缺能力时说明原因。", "description": "用户要求开发、修改或发布自己的工作台应用,或把固定应用版本分发到 GitHub/Gitea 与 Registry 时使用。按所选技术栈使用的外部 Node/Docker 运行时、托管、Git 服务和数据库须有真实环境或连接及适用条款,可能另行部署或收费;缺能力时说明原因。",
"body": "./SKILL.zh-CN.md", "body": "./SKILL.zh-CN.md",
"source_hash": "sha256:b12f9f3a566f3195", "source_hash": "sha256:9c37c5ad344e380e",
"translated_by": "ai:gpt-6", "translated_by": "ai:gpt-6",
"translated_at": "2026-10-13" "translated_at": "2026-10-28"
}, },
"en-US": { "en-US": {
"name": "Application Development and Publishing", "name": "Application Development and Publishing",
"short_desc": "Develop a personal workbench, publish it to My Apps, and distribute fixed releases on request", "short_desc": "Develop a personal workbench, publish it to My Apps, and distribute fixed releases on request",
"description": "Use when the user asks to develop, modify or publish a personal workbench application, or distribute a fixed release through GitHub/Gitea and Registry. Node/Docker runtimes, hosting, Git services and databases used by the chosen stack need actual environments or connections and applicable terms; separate deployment or costs may apply. Report unavailable capabilities.", "description": "Use when the user asks to develop, modify or publish a personal workbench application, or distribute a fixed release through GitHub/Gitea and Registry. Node/Docker runtimes, hosting, Git services and databases used by the chosen stack need actual environments or connections and applicable terms; separate deployment or costs may apply. Report unavailable capabilities.",
"body": "./SKILL.md", "body": "./SKILL.md",
"source_hash": "sha256:b12f9f3a566f3195", "source_hash": "sha256:9c37c5ad344e380e",
"translated_by": "ai:gpt-6", "translated_by": "ai:claude-opus-5-5",
"translated_at": "2026-10-13" "translated_at": "2026-10-28"
} }
} }
}, },
@@ -72,7 +72,7 @@ The Agent chooses the implementation, framework and working method. The platform
## L1: Read Capabilities and Context ## L1: Read Capabilities and Context
1. Read or create the task's single file-based Plan, preserving the actual Agent/session, device, authorized work directory and development Task. Continue within the user's existing requirements and authorization. 1. Read or create the task's single file-based Plan, preserving the actual Agent/session, device, authorized work directory and development Task. Continue within the user's existing requirements and authorization.
2. Use the original `AppManage` action `authoring_capabilities`. Require `capabilities.protocol: app-authoring-v1` and inspect supported, authorized, available and reason independently. Its `fileRoots` are real readable roots for the current Agent, and `registryTargetIds` are registered catalog targets. These read facts grant neither upload nor filesystem write authority. The minimum version is a code baseline, not proof that a shipped client supports this protocol. Authoring actions enter the original domain owners without passing platform credentials to the model. 2. Use the original `AppManage` action `authoring_capabilities`. Require `capabilities.protocol: app-authoring-v1` and inspect supported, authorized, available and reason independently. Its `fileRoots` are real readable roots for the current Agent, and `registryTargetIds` are registered catalog targets. These read facts grant neither upload nor filesystem write authority. `draftSource` is this conversation's draft source `{agentId,sessionId}`; copy it verbatim as the app-draft.json source. If the result carries `draftSourceUnavailable`, or an older client returns no such field, the current conversation ID is unavailable; handle it as described in L2. The minimum version is a code baseline, not proof that a shipped client supports this protocol. Authoring actions enter the original domain owners without passing platform credentials to the model.
3. Natural-language development needs no additional handoff protocol. Installation, registration, update or uninstall continues through ApplicationManagement-v2 and the single writer. Read `app-install-manager` when available; never edit installed-entries.json directly. 3. Natural-language development needs no additional handoff protocol. Installation, registration, update or uninstall continues through ApplicationManagement-v2 and the single writer. Read `app-install-manager` when available; never edit installed-entries.json directly.
4. Read [authoring interfaces](references/authoring-api.zh-CN.md) and [distribution](references/distribution.zh-CN.md) on demand. The candidate main-repository authority is `docs/功能/市场系统/API/应用开发发布接口.md`; an external PR does not establish a shipped client or official seed. `examples/static-workbench/` and `examples/service-workbench/` are editable teaching materials, not evidence of autonomous Agent development or production acceptance. 4. Read [authoring interfaces](references/authoring-api.zh-CN.md) and [distribution](references/distribution.zh-CN.md) on demand. The candidate main-repository authority is `docs/功能/市场系统/API/应用开发发布接口.md`; an external PR does not establish a shipped client or official seed. `examples/static-workbench/` and `examples/service-workbench/` are editable teaching materials, not evidence of autonomous Agent development or production acceptance.
@@ -81,7 +81,7 @@ The Agent chooses the implementation, framework and working method. The platform
- Establish the user's actual work, data ownership and collaboration needs. Choose suitable languages and frameworks; examples do not prescribe a stack. Reuse the actual Task, Plan and originating context. - Establish the user's actual work, data ownership and collaboration needs. Choose suitable languages and frameworks; examples do not prescribe a stack. Reuse the actual Task, Plan and originating context.
- Separate program material, business data and secrets. The portable `application.json` contains no sourceId, installation identity, host path, builtin route or credential. Its product identity, version and entrypoints are the single source for release and catalog views. - Separate program material, business data and secrets. The portable `application.json` contains no sourceId, installation identity, host path, builtin route or credential. Its product identity, version and entrypoints are the single source for release and catalog views.
- Create fixed `app-release.json` from an explicit file whitelist, actual byte hashes, entrypoint mappings, data contract and truthful platform evidence. Exclude the manifest itself from files. `scripts/create-release.mjs` builds the example manifest; the service independently verifies actual bytes. - Create fixed `app-release.json` from an explicit file whitelist, actual byte hashes, entrypoint mappings, data contract and truthful platform evidence. Exclude the manifest itself from files. `scripts/create-release.mjs` builds the example manifest; the service independently verifies actual bytes.
- Deliver `app-draft.json` with real fileRef, Plan, Agent/session, stable draftId and target installationId. Its workdir points to the actual release material directory; do not guess a release/ subdirectory or fabricate a fileRef. Read the actual authorized file using `AppManage.read_draft` with `file_ref`, preserving the returned draft. Return a clickable absolute path so the user can read and continue it in the application development workspace. - Deliver `app-draft.json` with real fileRef, Plan, stable draftId and target installationId. Its source is the `draftSource` returned by `authoring_capabilities`, copied verbatim; never use a runId or make up a value. Without `draftSource` (an older client, or a result with `draftSourceUnavailable`), ask the user for the current conversation ID, or ask the user to continue in this Agent's default conversation, whose sessionId equals the agentId. Never infer it from a runId, topic title or another conversation. Its workdir points to the actual release material directory; do not guess a release/ subdirectory or fabricate a fileRef. Read the actual authorized file using `AppManage.read_draft` with `file_ref`, preserving the returned draft. When read_draft, preview_prepare or development_enroll rejects the source conversation, the error body carries this conversation's `draftSource`; correct the draft's source with it and retry. Return a clickable absolute path so the user can read and continue it in the application development workspace.
- Call `AppManage.preview_prepare` with the original draft/mode/expectedRevision in `owner_request`, including release for snapshot. Use preview_read to read and preview_end to end it. Snapshot preview and formal installation use separate identities and data. Freeze a snapshot before publishing a live preview. Replacement uses the actual revision. Ending preview revokes its bridge and disposes only its owned temporary runtime while preserving data and development material. Closing a page does not stop a formal application or accepted Task. Never convert a temporary URL/token into a formal entrypoint. - Call `AppManage.preview_prepare` with the original draft/mode/expectedRevision in `owner_request`, including release for snapshot. Use preview_read to read and preview_end to end it. Snapshot preview and formal installation use separate identities and data. Freeze a snapshot before publishing a live preview. Replacement uses the actual revision. Ending preview revokes its bridge and disposes only its owned temporary runtime while preserving data and development material. Closing a page does not stop a formal application or accepted Task. Never convert a temporary URL/token into a formal entrypoint.
- Enroll a real authorized source development server using `AppManage.development_enroll` with the original prepareRef/draft/terminalId/endpoint in `owner_request` for live preview. Its development-only contract cannot become formal startup; mutable source and fixed releases remain separate. The original command must respect owner-injected PORT and APP_DATA_DIR, using shell `${VAR:-default}` only for initial defaults rather than overriding preview ports or formal data roots. - Enroll a real authorized source development server using `AppManage.development_enroll` with the original prepareRef/draft/terminalId/endpoint in `owner_request` for live preview. Its development-only contract cannot become formal startup; mutable source and fixed releases remain separate. The original command must respect owner-injected PORT and APP_DATA_DIR, using shell `${VAR:-default}` only for initial defaults rather than overriding preview ports or formal data roots.
- Use `AppManage.prepare_release` with the complete `release_request` to freeze real material. Construct materialRoot as a FileResourceRef from the returned readable roots. Inspect the candidate, then call commit_release with the complete original AppReleaseCommitRequest in `release_request`, retaining prepareRef, installationId, expectedRevision and submissionId. Do not reduce its installation material to a name or digest. Continue authorized publication without repeated per-command questions; new targets or additional data/external effects follow existing governance. - Use `AppManage.prepare_release` with the complete `release_request` to freeze real material. Construct materialRoot as a FileResourceRef from the returned readable roots. Inspect the candidate, then call commit_release with the complete original AppReleaseCommitRequest in `release_request`, retaining prepareRef, installationId, expectedRevision and submissionId. Do not reduce its installation material to a name or digest. Continue authorized publication without repeated per-command questions; new targets or additional data/external effects follow existing governance.
+2 -2
View File
@@ -7,7 +7,7 @@ Agent 选择技术栈、构建方法与工作方式;平台核验材料、作
## L1:先读能力与当前上下文 ## L1:先读能力与当前上下文
1. 读取或创建本任务唯一文件化 Plan,保存实际来源 Agent/会话、目标设备、工作目录及开发 Task。已有用户需求和授权直接沿用。 1. 读取或创建本任务唯一文件化 Plan,保存实际来源 Agent/会话、目标设备、工作目录及开发 Task。已有用户需求和授权直接沿用。
2. 使用原 `AppManage` 的 `authoring_capabilities` 动作。返回的 `capabilities` 必须为 `protocol: app-authoring-v1`,分别看 features 的 supported、authorized、available 和 reason;`fileRoots` 是当前 Agent 可读的真实文件根,`registryTargetIds` 是已登记的目录目标;这些只读事实不授予目录上传或文件写权限。10.0.180 只是代码基线,已发行的同版本客户端不因此支持新协议。作者动作直接进入原领域 owner,不把平台凭据交给模型。 2. 使用原 `AppManage` 的 `authoring_capabilities` 动作。返回的 `capabilities` 必须为 `protocol: app-authoring-v1`,分别看 features 的 supported、authorized、available 和 reason;`fileRoots` 是当前 Agent 可读的真实文件根,`registryTargetIds` 是已登记的目录目标;这些只读事实不授予目录上传或文件写权限。`draftSource` 是本次会话的草稿来源 `{agentId,sessionId}`,原样写入 app-draft.json 的 source;返回 `draftSourceUnavailable`,或旧客户端没有这个字段时,当前会话 ID 拿不到,按 L2 处理。10.0.180 只是代码基线,已发行的同版本客户端不因此支持新协议。作者动作直接进入原领域 owner,不把平台凭据交给模型。
3. 普通自然语言开发不要求新的交接协议。若要登记、安装、更新或卸载,读取 `app-install-manager`;继续沿 ApplicationManagement-v2 解析和唯一 writer,不直接编辑 installed-entries.json。 3. 普通自然语言开发不要求新的交接协议。若要登记、安装、更新或卸载,读取 `app-install-manager`;继续沿 ApplicationManagement-v2 解析和唯一 writer,不直接编辑 installed-entries.json。
4. 按需读 [作者接口](references/authoring-api.zh-CN.md) 和 [分发指南](references/distribution.zh-CN.md)。候选主仓正文为 `docs/功能/市场系统/API/应用开发发布接口.md`,按实际能力读取;外仓 PR 不表示客户端或官方 seed 已发行。两份示例位于 `examples/static-workbench/` 与 `examples/service-workbench/`,只是可修改的教学材料,不能代替真实 Agent 开发和业务验收。 4. 按需读 [作者接口](references/authoring-api.zh-CN.md) 和 [分发指南](references/distribution.zh-CN.md)。候选主仓正文为 `docs/功能/市场系统/API/应用开发发布接口.md`,按实际能力读取;外仓 PR 不表示客户端或官方 seed 已发行。两份示例位于 `examples/static-workbench/` 与 `examples/service-workbench/`,只是可修改的教学材料,不能代替真实 Agent 开发和业务验收。
@@ -16,7 +16,7 @@ Agent 选择技术栈、构建方法与工作方式;平台核验材料、作
- 先确认要解决的工作、数据位置与必要协作。可以使用任何适合的语言/框架,示例不固定技术栈。小任务直接完成;复杂工作保留原 Task、Plan 和用户来源,不另造开发状态机。 - 先确认要解决的工作、数据位置与必要协作。可以使用任何适合的语言/框架,示例不固定技术栈。小任务直接完成;复杂工作保留原 Task、Plan 和用户来源,不另造开发状态机。
- 程序材料、业务数据与秘密分开。作者定义 `application.json` 不包含 sourceId、安装实例、宿主路径、builtin 路由或权限凭据。release 的产品 ID/名称/版本/入口只有这份定义。 - 程序材料、业务数据与秘密分开。作者定义 `application.json` 不包含 sourceId、安装实例、宿主路径、builtin 路由或权限凭据。release 的产品 ID/名称/版本/入口只有这份定义。
- 固定 `app-release.json`:按显式文件白名单、原始字节摘要、入口映射、数据合同和真实平台证据生成;清单自身不进入 files。可用 `scripts/create-release.mjs` 为示例生成清单,平台仍重新核验实际字节。 - 固定 `app-release.json`:按显式文件白名单、原始字节摘要、入口映射、数据合同和真实平台证据生成;清单自身不进入 files。可用 `scripts/create-release.mjs` 为示例生成清单,平台仍重新核验实际字节。
- 向平台交付 `app-draft.json`,记录真实 fileRef、Plan、Agent/session、稳定 draftId 与目标 installationId。workdir 指向实际完成的 release 材料目录,不猜测 release/ 子目录,也不编造 fileRef。用 `AppManage.read_draft` 的 `file_ref` 读取授权根内实际文件,保留返回的 draft。返回此文件的可点击绝对路径,说明可在应用开发工作区读取并继续。 - 向平台交付 `app-draft.json`,记录真实 fileRef、Plan、稳定 draftId 与目标 installationId。source 原样使用 `authoring_capabilities` 返回的 `draftSource`,不填 runId,也不自己编一个值。没有 `draftSource` 时(旧客户端,或返回 `draftSourceUnavailable`),请用户提供当前会话 ID,或请用户改在该 Agent 的默认会话里继续(默认会话的 sessionId 等于 agentId),不要从 runId、话题标题或别的会话推断。workdir 指向实际完成的 release 材料目录,不猜测 release/ 子目录,也不编造 fileRef。用 `AppManage.read_draft` 的 `file_ref` 读取授权根内实际文件,保留返回的 draft。read_draft、preview_prepare、development_enroll 因来源会话被拒时,错误正文会带回本次会话的 `draftSource`,按它改正草稿的 source 再重试。返回此文件的可点击绝对路径,说明可在应用开发工作区读取并继续。
- 预览沿 `AppManage.preview_prepare` 的 `owner_request` 传原 draft/mode/expectedRevision,snapshot 另给 release;读取用 preview_read,结束用 preview_end。snapshot 预览与正式安装隔离,数据不自动转移。live 预览必须先固定 snapshot 才可发布;刷新/替换用实际 revision。结束预览撤销当前桥并回收本次 owned 临时运行资源,保留数据与开发材料;普通关页不停止正式应用或已接纳的后台 Task,不将预览临时 URL/token 保存为正式入口。 - 预览沿 `AppManage.preview_prepare` 的 `owner_request` 传原 draft/mode/expectedRevision,snapshot 另给 release;读取用 preview_read,结束用 preview_end。snapshot 预览与正式安装隔离,数据不自动转移。live 预览必须先固定 snapshot 才可发布;刷新/替换用实际 revision。结束预览撤销当前桥并回收本次 owned 临时运行资源,保留数据与开发材料;普通关页不停止正式应用或已接纳的后台 Task,不将预览临时 URL/token 保存为正式入口。
- 原开发服务器/HMR 使用真实授权的 draft 工作目录,由 `AppManage.development_enroll` 的 `owner_request` 传原 prepareRef/draft/terminalId/endpoint 接入。它只用于 live 预览,不能成为正式 startup;可变源码与固定 release 分开。原命令须尊重 owner 注入的 PORT 和 APP_DATA_DIR,初次开发默认值用 shell 的 `${VAR:-default}`,不能写死赋值盖掉预览端口或正式数据根。 - 原开发服务器/HMR 使用真实授权的 draft 工作目录,由 `AppManage.development_enroll` 的 `owner_request` 传原 prepareRef/draft/terminalId/endpoint 接入。它只用于 live 预览,不能成为正式 startup;可变源码与固定 release 分开。原命令须尊重 owner 注入的 PORT 和 APP_DATA_DIR,初次开发默认值用 shell 的 `${VAR:-default}`,不能写死赋值盖掉预览端口或正式数据根。
- 个人发布由 `AppManage.prepare_release` 的 `release_request` 固定真实材料:materialRoot 使用能力返回的授权根构造 FileResourceRef。检查候选后,`commit_release` 的 `release_request` 使用完整原 AppReleaseCommitRequest,保留精确 prepareRef、installationId、expectedRevision 与原 submissionId;不能把安装 material 对象简化为产品名称或摘要。旧会话里明确授权的发布可继续,不逐命令重复确认。新目标或超出授权的数据/外部副作用沿现有治理处理。 - 个人发布由 `AppManage.prepare_release` 的 `release_request` 固定真实材料:materialRoot 使用能力返回的授权根构造 FileResourceRef。检查候选后,`commit_release` 的 `release_request` 使用完整原 AppReleaseCommitRequest,保留精确 prepareRef、installationId、expectedRevision 与原 submissionId;不能把安装 material 对象简化为产品名称或摘要。旧会话里明确授权的发布可继续,不逐命令重复确认。新目标或超出授权的数据/外部副作用沿现有治理处理。
@@ -29,13 +29,13 @@
}, },
"release": { "release": {
"state": "known", "state": "known",
"version": "1.0.0", "version": "1.0.1",
"versionScheme": "semver" "versionScheme": "semver"
}, },
"timestamps": { "timestamps": {
"catalogUpdatedAt": { "catalogUpdatedAt": {
"state": "known", "state": "known",
"value": "2026-10-13", "value": "2026-10-28",
"precision": "day" "precision": "day"
}, },
"releasePublishedAt": { "releasePublishedAt": {
@@ -6,7 +6,7 @@ Agent 使用原 `AppManage` 的有限作者动作,直接进入已有 release
| AppManage action | 参数包络 | 返回事实 | | AppManage action | 参数包络 | 返回事实 |
|---|---|---| |---|---|---|
| `authoring_capabilities` | 无额外参数 | `capabilities` 的实际 features/policy/hostInstanceId 和当前 Agent 可读的 `fileRoots` 与已登记的 `registryTargetIds`;不授上传或文件写权限 | | `authoring_capabilities` | 无额外参数 | `capabilities` 的实际 features/policy/hostInstanceId 和当前 Agent 可读的 `fileRoots` 与已登记的 `registryTargetIds`;本次会话可用作草稿来源时给 `draftSource:{agentId,sessionId}`,否则给 `draftSourceUnavailable`(旧客户端两者都没有);不授上传或文件写权限 |
| `read_draft` | `file_ref: FileResourceRef` | 从真实授权文件读取并核验的 `draft: AppDraftRef` | | `read_draft` | `file_ref: FileResourceRef` | 从真实授权文件读取并核验的 `draft: AppDraftRef` |
| `prepare_release` | `release_request: AppReleasePrepareRequest` | owned candidate、真实 payload/descriptor 摘要、当前 expectedRevision | | `prepare_release` | `release_request: AppReleasePrepareRequest` | owned candidate、真实 payload/descriptor 摘要、当前 expectedRevision |
| `commit_release` | `release_request: AppReleaseCommitRequest` | 唯一 writer CAS 保存;activation 与保存分别核验 | | `commit_release` | `release_request: AppReleaseCommitRequest` | 唯一 writer CAS 保存;activation 与保存分别核验 |
@@ -32,7 +32,9 @@ Agent 使用原 `AppManage` 的有限作者动作,直接进入已有 release
`commit_release` 使用原 prepareRef、expectedRevision(首次为 none,更新取原安装修订)、稳定 submissionId、完整 material(已解析的 ApplicationInstallationRequest)。登记失败先用 lookup_release_submission 查同安装同提交,不重新复制/启动软件。只读动作不触发修改审批;修改动作继续沿原工具审批和最终材料/调用身份复验。调用取消的短授权不保存为长期运行权限,已接纳的后台工作与 owned 临时预览补偿分别按其原 owner 管理。 `commit_release` 使用原 prepareRef、expectedRevision(首次为 none,更新取原安装修订)、稳定 submissionId、完整 material(已解析的 ApplicationInstallationRequest)。登记失败先用 lookup_release_submission 查同安装同提交,不重新复制/启动软件。只读动作不触发修改审批;修改动作继续沿原工具审批和最终材料/调用身份复验。调用取消的短授权不保存为长期运行权限,已接纳的后台工作与 owned 临时预览补偿分别按其原 owner 管理。
`AppDraftRef` 文件有 `schemaVersion:1`、稳定 draftId/appId、实际授权 `workdir`、绝对 planPath、真实 `source:{agentId,sessionId}`,可选 targetInstallationId/baselineReleaseDigest。文件引用从当前请求或授权读取工具取得。preview_prepare 用原 draft、mode、expectedRevision,snapshot 还给 release;结束只传原 draftId/revision,不能猜最近草稿或 borrowed 正式作用域。 `AppDraftRef` 文件有 `schemaVersion:1`、稳定 draftId/appId、实际授权 `workdir`、绝对 planPath、真实 `source:{agentId,sessionId}`,可选 targetInstallationId/baselineReleaseDigest。source 原样取 `authoring_capabilities` 返回的 `draftSource`:默认会话的 sessionId 等于 agentId,手动话题是 `__manual:<uuid>`,两者都不是 runId,模型从上下文得不到,不能猜或自拟。返回 `draftSourceUnavailable`(本次会话不能作为草稿来源),或旧客户端不返回 `draftSource` 时,请用户提供当前会话 ID,或请用户改在该 Agent 的默认会话里继续:新客户端在默认会话里重新探测取 draftSource,旧客户端按 sessionId 等于 agentId 写入。文件引用从当前请求或授权读取工具取得。preview_prepare 用原 draft、mode、expectedRevision,snapshot 还给 release;结束只传原 draftId/revision,不能猜最近草稿或 borrowed 正式作用域。
read_draft、preview_prepare、development_enroll 等动作因来源会话被拒(`application_preview_source_unavailable`、`application_draft_not_authorized`、`application_draft_authority_required`)时,新客户端的错误正文除 error 外还带本次会话的 `draftSource`。按它改正 app-draft.json 的 source,重新 read_draft 后再重试原动作。错误正文没有 draftSource,或 source 已与它一致仍被拒,原因不在会话 ID(如 workdir 的 agentId 或授权根不符,或本次会话不能作为草稿来源),按错误码排查,不反复改 source。
release 采用 `schemaVersion:1` / `canonicalization: app-release-c14n-v1`,包括 definition、delivery、files、source、supportedPlatforms、requiredCapabilities。files 的 role 为 definition/ui/runtime/dependency/documentation/license/evidence/data-contract;路径为包内规范 POSIX。definition 文件必须与 manifest.definition 一致。`app-release.json` 本身不放入 files,不能让摘要自引用。 release 采用 `schemaVersion:1` / `canonicalization: app-release-c14n-v1`,包括 definition、delivery、files、source、supportedPlatforms、requiredCapabilities。files 的 role 为 definition/ui/runtime/dependency/documentation/license/evidence/data-contract;路径为包内规范 POSIX。definition 文件必须与 manifest.definition 一致。`app-release.json` 本身不放入 files,不能让摘要自引用。