zireael-error-contracts
Keep ZR_ERR_* codes and "no partial effects" contracts consistent across the engine.
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
When to use
Use this skill when:
- adding/modifying public
engine_*APIs - writing parsers/validators (drawlist, input, UTF-8)
- changing cap enforcement (
zr_limits_t) - changing "no partial effects" behavior
Source of truth
-
docs/ERROR_CODES_CATALOG.md— error semantics and state effects -
docs/SAFETY_RULESET.md— safety and cleanup rules -
src/util/zr_result.h— actual error codes
Core rules (must follow)
-
ZR_OK == 0 - Failures are negative (
ZR_ERR_*) - Default: no partial effects on failure
- Only permitted partial output: event batch truncation (success with
TRUNCATEDflag)
Error codes
| Code | Meaning |
|---|---|
ZR_ERR_INVALID_ARGUMENT |
NULL or invalid parameter |
ZR_ERR_OOM |
Allocation/arena growth failed |
ZR_ERR_LIMIT |
Caps exceeded or buffer too small |
ZR_ERR_FORMAT |
Malformed input bytes |
ZR_ERR_UNSUPPORTED |
Unknown version/opcode/feature |
ZR_ERR_PLATFORM |
Backend/OS failure |
Implementation checklist
- Identify failure classes your code can hit
- Decide "state mutated?" explicitly
- Validators run fully before any mutation
- Writers never emit partial records
Test guidance
- Invalid args →
ZR_ERR_INVALID_ARGUMENT, no mutation - Caps exceeded →
ZR_ERR_LIMIT, no mutation - Bad format →
ZR_ERR_FORMAT/ZR_ERR_UNSUPPORTED, no partial effects - Event truncation → success with
TRUNCATEDflag, only complete records
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-03-11
- 索引更新时间
- 2026-03-11
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!