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.
- Gate rules push behind --yes at CLI and domain layers (fail-closed on
dryRun=false without confirm)
- Raise webhook replay partial failure as CliError so exit 1 survives
cli.ts exitCode overwrite; route webhook stdout through printJson for
exit-12 protection and --output-file support
- Narrow MCP read-only allowlist: drop config mode/lint (write forms are
indistinguishable under token-prefix matching; config get covers reads)
- Extract redactSensitiveText to core, extend credential patterns, apply
to HTTP sendError/500 and domain error messages
- Pass release TAG_NAME via env instead of inline ${{ }} interpolation
to close script injection through crafted tag names
- Track .zcodeignore so enterprise credential exclusions travel with the
repo
- Add .agents/rules/security-posture.md documenting usability-first
accepted risks (loopback adapter auth, update verification, mutation
command gates, skill dump stdout); register skill dump as a documented
stdout Markdown exception in AGENTS.md and cli-protocol.md
- Rebuild dist/mcp/server.js
- Clarify dataset naming as Webhook 资源包 (CLI: resource-pack, alias: pack), distinguishing from backend native simulation material pack while retaining material-pack as backward-compatible alias
- Implement exportApprovalRunsToResourcePack for exporting online approval runs and attachments into local resource pack ZIP
- Support seal-use webhook resource-pack export with record filters, docId prefix/suffix, and destination options
- Refine bidirectional directory validation to allow documents without attachments
- Update CLI runner, help definitions, and skill references
- Add comprehensive export, preview, and CLI command unit tests
- Replace filename-heuristic attachment matching with explicit [附件] column declaration
- AttachmentGroup replaces MaterialAttachmentEntry: uses paths[] instead of entries[]
- parseMaterialWorkbook now exports DeclaredAttachment and full Parsed type including
documentAttachments, expenseAttachments, personAttachments per row
- buildAttachmentPlans enforces strict bidirectional validation:
1. Every Excel [附件] path must exist in ZIP
2. Every ZIP file must be declared in some [附件] column
- validateDocIdDirectories now strips @annotation suffix when matching documentIds
- injectAttachmentPlan updated to work with new AttachmentGroup.paths API
- pushMaterialPack iterates group.paths for uploads, adding stderr diagnostics
- Key deduplication applied at parse time (deduplicateKeys)
- Tests updated: [附件] column fixtures, bidirectional validation error tests,
@ annotation matching test, preview injection test
- Skill docs updated: Material Pack Workflow section in references/cli.md
- Version bumped to 0.10.12