code-engine-update

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Code Engine Package Update (CLI)

Code Engine 包更新(CLI)

Use this skill for package update/version workflows and safe contract evolution.
使用此skill进行包更新/版本工作流和安全的契约演进。

Intent

意图

This skill covers:
  • update existing package code
  • create a new version on an existing package id
  • detect and handle mapping drift between package and app manifest
  • validate datatype contract stability
For app-runtime invocation code, use
~/.agents/skills/code-engine/SKILL.md
.
此skill涵盖:
  • 更新现有包代码
  • 在现有包ID上创建新版本
  • 检测并处理包与应用清单之间的映射漂移
  • 验证数据类型契约稳定性
对于app-runtime调用代码,请使用
~/.agents/skills/code-engine/SKILL.md
。

Primary Execution Path

主要执行路径

Prefer
community-domo-cli
:
bash
community-domo-cli --instance <instance> code-engine update-version <package_id> <version> --body-file payload.json
Fallback endpoint pattern:
http
POST /api/codeengine/v2/packages
with
id
and
version
set in body for versioned update behavior.
优先使用
community-domo-cli
:
bash
community-domo-cli --instance <instance> code-engine update-version <package_id> <version> --body-file payload.json
备用端点模式:
http
POST /api/codeengine/v2/packages
在请求体中设置
id
和
version
以实现版本化更新行为。

Release Safety Rule

发布安全规则

Hard rule: never call any Code Engine release endpoint unless the user explicitly says "release".
  • Do not infer release from context.
  • Do not release as part of "finish", "publish", or "make it work".
  • If release appears necessary, stop and ask for explicit release approval first.
硬性规则:除非用户明确说**“release”**,否则绝不调用任何Code Engine发布端点。
  • 不要从上下文推断发布。
  • 不要将发布作为“完成”、“发布”或“使其工作”的一部分。
  • 如果发布看似必要,请先停止并请求明确的发布批准。

Update/New-Version Behavior

更新/新版本行为

Preferred create/update model:
  1. Create a new package:
    POST /api/codeengine/v2/packages
  2. Create a new version of an existing package: also
    POST /api/codeengine/v2/packages
    with
    id
    and
    version
    (for example
    1.0.1
    ) in the request body, including code/manifest payload.
  3. Update an existing package version:
    PUT /api/codeengine/v2/packages/{id}/versions/{version}
  4. If update fails because the target version is deployed/immutable, create a new version and then update that new version.
Execution notes:
  • For new-version creation, prefer creating the version with full code+manifest payload immediately.
  • Use
    PUT
    for subsequent changes to that specific version.
Always emit resulting
packageId
and
version
for downstream manifest sync.
首选创建/更新模型:
  1. 创建新包:
    POST /api/codeengine/v2/packages
  2. 创建现有包的新版本:同样使用
    POST /api/codeengine/v2/packages
    ,在请求体中包含
    id
    和
    version
    (例如
    1.0.1
    ),包括代码/清单负载。
  3. 更新现有包版本:
    PUT /api/codeengine/v2/packages/{id}/versions/{version}
  4. 如果更新失败,因为目标版本已部署/不可变,请创建新版本,然后更新该新版本。
执行说明:
  • 对于新版本创建,建议立即使用完整的代码+清单负载创建版本。
  • 对于该特定版本的后续更改,使用
    PUT
    。
始终输出最终的
packageId
和
version
以进行下游清单同步。

Contract Safeguards

契约保护

Before update publish:
  • compare existing function aliases vs proposed aliases
  • compare parameter names/types/nullability
  • compare output shape/type
  • flag breaking changes (removed required params, incompatible type changes)
When breaking change is intentional, require explicit migration note in generated output.
在更新发布前:
  • 比较现有函数别名与建议别名
  • 比较参数名称/类型/可空性
  • 比较输出形状/类型
  • 标记破坏性变更(移除必需参数、不兼容的类型变更)
当破坏性变更是有意为之,需要在生成的输出中提供明确的迁移说明。

Drift Handling

漂移处理

After update:
  • compare
    manifest.json packagesMapping
    against returned package id/version
  • sync
    packageId
    ,
    version
    , and parameter/output contracts when drift detected
  • keep mapping aliases stable unless user requested rename
更新后:
  • 将
    manifest.json packagesMapping
    与返回的包id/version进行比较
  • 检测到漂移时,同步
    packageId
    、
    version
    以及参数/输出契约
  • 保持映射别名稳定,除非用户要求重命名

Checklist

检查清单

  • Correct update path selected (existing vs versioned)
  • Input/output datatype contracts validated
  • Breaking changes flagged clearly
  • Manifest
    packagesMapping
    drift checked and synchronized
  • Output includes updated package id/version and contract summary
  • 选择了正确的更新路径(现有 vs 版本化)
  • 输入/输出数据类型契约已验证
  • 破坏性变更已清晰标记
  • 清单
    packagesMapping
    漂移已检查并同步
  • 输出包含更新的包id/version和契约摘要