Add exit codes 13 and 14 for config validation and safety blocks
The classifier only matched English usage wording, so every Chinese-language
usage error, every enterprise-selection failure, and every Zod/SyntaxError
fell through to exit 1 ("upstream failure"), while environment safety guards
were reported as exit 2 or 1. Add two semantic codes:
- 13 (validationError): well-formed command, unusable value — missing --corp,
unparseable enterprise JSON, missing required parameter, ambiguous webhook
channel selection.
- 14 (safetyBlocked): the target environment forbids the action — replaying
into production, regression outside a test tenant.
classifyCliError now recognises Chinese usage wording, enterprise-selection
phrasing, local file problems, Zod issue lists (structural, not textual) and
SyntaxError; English Usage:/Unknown-command stays 2, domain failures and
quality gates stay 1. Docs (AGENTS, cli-protocol, skill cli.md) and the exit
code assertions follow.
This commit is contained in:
1 parent
5f4906758e
commit
66eb81f3d1
12 files changed
+177
-134
No files matched your search
@@ -387,7 +387,9 @@ describe("seal-use webhook replay CLI", () => {
|
||||
"--dry-run"
|
||||
]);
|
||||
expect(blockedResult.isError).toBe(true);
|
||||
expect(blockedResult.exitCode).toBe(1);
|
||||
// 14: safety block — the target environment forbids the action, not the
|
||||
// shape of the command line.
|
||||
expect(blockedResult.exitCode).toBe(14);
|
||||
expect(blockedResult.stderr).toContain("标记为生产正式环境");
|
||||
|
||||
// With --force
|
||||
|
||||
Reference in new issue
Block a user