diff --git a/skills/seal-use/references/approval-run-lightweight.md b/skills/seal-use/references/approval-run-lightweight.md index 1d91994..6fd9ff5 100644 --- a/skills/seal-use/references/approval-run-lightweight.md +++ b/skills/seal-use/references/approval-run-lightweight.md @@ -76,7 +76,7 @@ seal-use approval-runs get --raw-json --full --corp - `--raw-json` 保留上游响应的 JSON 结构(包括 `data` 包装、嵌套内容、新字段及上游同名字段),绕过审核记录的业务 schema 校验,不额外添加或覆盖字段。它仍只调用同一条只读审核详情接口,沿用企业认证和 HTTP 错误处理。 - 该模式解析并重新序列化 JSON,缩进等文本格式可能变化,不是 HTTP 响应的字节级副本。上游未返回的内容不会补查;无效 JSON、网络错误或 HTTP 失败仍按原协议报错。 - 输出不会静默截断。共享的 stdout 大小保护超过 200,000 字节时返回退出码 12;`--full` 或 `--output-file` 可输出完整内容。`--full` 只控制大小保护,不会绕过字段校验,也不会撤销 `--summary/--fields`。 -- `--raw-json` 不能与 `--summary`、`--fields` 或 `--flow` 同用;这些参数会改写结构或切换接口,CLI 会以退出码 2 明确拒绝。写入文件时 stdout 仅返回文件路径和字节数的 JSON 回执,原生响应保存在文件中。 +- `--raw-json` 不能与 `--summary` 或 `--fields` 同用;这两个参数会改写返回结构,CLI 会以退出码 2 明确拒绝。需要合思原生审批流时间线时,用 `seal-use approval-runs hose-flow `,不要从审核详情接口取。写入文件时 stdout 仅返回文件路径和字节数的 JSON 回执,原生响应保存在文件中。 - 不把兜底入口作为默认查询,也不将大段原生 JSON 直接贴给用户;Agent 可按需读取文件中的特定字段。 ## Understand The Case First diff --git a/src/cli/commands/approval-runs.test.ts b/src/cli/commands/approval-runs.test.ts index 8705618..6fdb8d8 100644 --- a/src/cli/commands/approval-runs.test.ts +++ b/src/cli/commands/approval-runs.test.ts @@ -102,6 +102,9 @@ describe("approval run native JSON fallback", () => { expect(result.exitCode).toBe(2) expect(result.stdout).toBe("") expect(result.stderr).toContain("--raw-json cannot be combined") + // The message names only what the caller actually passed, so the retired + // `--flow` spelling is never advertised to anyone who did not use it. + expect(result.stderr).toContain(flags[0]!) } expect(requests).toHaveLength(0) }) diff --git a/src/cli/commands/approval-runs.ts b/src/cli/commands/approval-runs.ts index cb552a9..597a288 100644 --- a/src/cli/commands/approval-runs.ts +++ b/src/cli/commands/approval-runs.ts @@ -190,8 +190,15 @@ export async function handleApprovalRunsCommand( const recordId = args.command[2]; if (!recordId) throw new Error("Missing approval run recordId"); const rawJson = booleanOption(args.options["raw-json"]) ?? booleanOption(args.options.rawJson); - if (rawJson && (booleanOption(args.options.flow) || booleanOption(args.options.summary) || stringOption(args.options.fields) !== undefined)) { - throw usageError("--raw-json cannot be combined with --flow, --summary or --fields"); + if (rawJson) { + // Name only the flags the caller actually passed: legacy spellings stay + // implementation-only and must not be advertised to everyone else. + const conflicts = [ + booleanOption(args.options.flow) ? "--flow" : undefined, + booleanOption(args.options.summary) ? "--summary" : undefined, + stringOption(args.options.fields) !== undefined ? "--fields" : undefined + ].filter((flag): flag is string => flag !== undefined); + if (conflicts.length) throw usageError(`--raw-json cannot be combined with ${conflicts.join(", ")}`); } if (booleanOption(args.options.flow)) { await runCapability( diff --git a/src/cli/help.ts b/src/cli/help.ts index 4da0cbf..38c6829 100644 --- a/src/cli/help.ts +++ b/src/cli/help.ts @@ -578,7 +578,7 @@ export const HELP_REGISTRY: AreaHelp[] = [ summary: "Get detailed approval record payload", usage: ["seal-use approval-runs get [--summary] [--fields metadata|document.fields,result.summary] [--raw-json] [--full] [--output-file file.json] [--corp ]"], options: [ - { flag: "--raw-json", description: "Compatibility fallback: return the upstream JSON response including its envelope and unknown fields, without business-schema validation or derived fields; incompatible with --summary, --fields and --flow" }, + { flag: "--raw-json", description: "Compatibility fallback: return the upstream JSON response including its envelope and unknown fields, without business-schema validation or derived fields; incompatible with --summary and --fields. Native Hose flow timeline lives in `seal-use approval-runs hose-flow `" }, { flag: "--full", description: "Bypass the shared 200,000-byte stdout size guard; this does not change payload structure" }, { flag: "--output-file ", description: "Write the complete JSON payload to a file, bypassing the stdout size guard" } ] diff --git a/src/cli/naming-charter.test.ts b/src/cli/naming-charter.test.ts index 728e7ca..123a391 100644 --- a/src/cli/naming-charter.test.ts +++ b/src/cli/naming-charter.test.ts @@ -76,6 +76,16 @@ describe("naming charter: visible help surface", () => { const offenders = LEGACY_SURFACE_TOKENS.filter((token) => serialized.includes(token)); expect(offenders).toEqual([]); }); + + test("never documents the retired bare flow switch", () => { + // `--flow` on `approval-runs get` is a silent legacy alias for + // `approval-runs hose-flow`, so the visible surface must not name it. + // LEGACY_SURFACE_TOKENS matches by substring and cannot express this: + // `--flow-id`, `--flow-ids` and `--flow-concurrency` are canonical. + const serialized = JSON.stringify(HELP_REGISTRY); + const offenders = serialized.match(/--flow(?![A-Za-z0-9-])/g) ?? []; + expect(offenders).toEqual([]); + }); }); describe("naming charter: parser accepts canonical and legacy spellings", () => {