Initial release of guardrail.lua — runtime contracts and structured validation for Lua.
Highlights
- Dependency-free runtime validation for Lua 5.1–5.4 and LuaJIT
- Primitive, literal, enum, union, optional, nullable, custom, and lazy schemas
- Object, array, tuple, and map validation with nested error paths
- Function contracts with argument/return validation, preconditions, postconditions, and preserved multiple returns
- State invariants with protected mutation helpers
- Structured GuardrailError objects with stable error codes and human-readable formatting
- Defensive defaults for unknown fields, sparse arrays, cyclic data, depth limits, and error-value privacy
- Explicit, non-mutating transformations and unknown-field stripping
- Boundary helpers for configuration, plugins, responses, and events
- LuaLS/EmmyLua annotation generation
- LuaRocks packaging, CI workflow, examples, benchmarks, and release documentation
Installation
luarocks install guardrail
Validation
- lua spec/run.lua — 11 passing tests
- Both development and release rockspecs pass luarocks lint