diff --git a/skills/seal-use/references/cli.md b/skills/seal-use/references/cli.md index 3649995..ef6d5d5 100644 --- a/skills/seal-use/references/cli.md +++ b/skills/seal-use/references/cli.md @@ -28,7 +28,7 @@ override that path. The legacy `current-corp` file is not read. - **`stdout`**: Pure, deterministic JSON for machine/Agent parsing. - **`stderr`**: Diagnostics, probing logs, and **Next-Step Command Suggestions** (e.g. `👉 Next action: ...`). -- **`Exit Code`**: `0` on success, non-zero (e.g. `1`) on failure to trigger Agent error self-remediation. +- **`Exit Code`**: `0` on success; `1` for runtime/upstream failures, `2` for usage or argument errors, `10` when an explicit destructive-operation confirmation is required, `11` for missing/invalid authentication, and `12` when output protection requires a compact or file-based query. ## Top-Level Commands @@ -145,6 +145,13 @@ Approval rule maintenance: - `seal-use rules push [--file ] [--corp ] [--publish] [--version-name ] [--dry-run|--yes]` - `seal-use rules clear [--corp ] [--dry-run|--yes]` +Rule identity and versioning: + +- `rules list` and `rules pull` read the current **draft** rule set. Their `code` values belong to the draft code space. +- A published version has its own snapshot and code space. Publishing can recode rules, so a published `code` may differ from the draft `code`, and codes can shift again after later edits and publishes. +- Do not use a draft `#NN` as a cross-version identifier. For current draft work, prefer the stable rule `id`; for historical behavior, select the published `version` and locate the rule by its text/context or runtime rule ID from the approval run. +- `rules get --version ... --code ...` interprets `code` inside that selected published version, while `rules get --record-id ... --runtime-id ...` resolves the version recorded on the run. + Approval run lightweight queries: - `seal-use approval-runs get --corp --fields metadata` diff --git a/skills/seal-use/references/rule-lightweight.md b/skills/seal-use/references/rule-lightweight.md index babf45a..0b42305 100644 --- a/skills/seal-use/references/rule-lightweight.md +++ b/skills/seal-use/references/rule-lightweight.md @@ -2,6 +2,12 @@ Use this reference when the user wants rule counts, compact rule lists, one rule from a historical version, or approval knowledge search without dumping hundreds of rule descriptions. +## Draft and Published Rule Codes + +`rules list` and `rules pull` operate on the current draft and therefore return draft `code` values. A published version stores a separate snapshot and may recode the same rules; publishing, deleting, or reordering rules can make those published codes differ or drift again. A code such as `#0038` is only meaningful together with its version context. + +Use the draft `id` for current edits and use the approval run's recorded version plus rule text or runtime rule ID for historical investigations. Do not copy a draft code into a report or command that will be interpreted against a published version. + ## Count Rules Use count when only scale or existence matters. diff --git a/src/domains/seal/tools.ts b/src/domains/seal/tools.ts index ee66fd1..a69ad29 100644 --- a/src/domains/seal/tools.ts +++ b/src/domains/seal/tools.ts @@ -209,7 +209,7 @@ export const sealTools = [ }, { name: "seal_approval_rules_list", - description: "列出 Seal 当前草稿审批规则;支持 countOnly、fields、limit 以避免返回规则正文", + description: "列出 Seal 当前草稿审批规则;返回的 code 属于草稿编号体系,发布版本可能重新编码;支持 countOnly、fields、limit 以避免返回规则正文", parameters: z.object({ countOnly: z.boolean().optional().describe("只返回规则数量,不返回规则列表"), fields: z.array(z.enum([ @@ -423,7 +423,7 @@ export const sealTools = [ }, { name: "seal_approval_rule_get", - description: "按版本号/code/runtime-id/record-id 定位单条规则,避免拉取整版规则快照", + description: "按版本号/code/runtime-id/record-id 定位单条规则;code 只在选定的版本编号体系内有效,避免拉取整版规则快照", parameters: z.object({ versionId: z.string().optional().describe("规则版本 ID"), versionNumber: z.number().int().positive().optional().describe("规则版本号"),