Sample
Measure custom validators and composite option types in NimbleOptions 1.1.1
sha256:bf574f199498ebc024cf6e9bdea360f62321db0b50dba14496f956334bbf700f
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Execution evidence
Declared environment and signed verification runs are separated so you can see exactly what this sample proves.
Evidence basisSigned contract pass
Verification receipts1
Verification levelL3_CONTRACT_PASS
Declared environment
- Execution context
- elixir 1
- Operating system
- linux
- Architecture
- x64
- Runtime
- elixir 1
- Language
- elixir
- Package manager
- mix
Verification-run environments
- Execution context
- elixir 1
- Operating system
- linux alpine · musl
- Architecture
- x64
- Runtime
- elixir 1
- Language
- elixir
- Package manager
- mix
- Execution
- container · docker
CONTAINER_RUN · compile:PASS · contract:PASS · load:PASS · resolve:PASS · hex@1 · 2026-08-17
Case
- Goal
- Measure custom validators and composite option types in NimbleOptions 1.1.1 HOW
- Packages
-
nimble_options 1.1.1
- Environment
- elixir 1
- Created
- 2026-08-17T04:44:18Z
Commonly assumed
A NimbleOptions custom validator can be an anonymous function that returns a boolean and receives its value after any configured arguments.
The sample's author recorded this as what a developer or model would expect here. The contract below is what actually ran.
Contract
- assert a custom validator uses an MFA 4-tuple, receives the option value first, returns {:ok, transformed} or {:error, message}, and can replace the validated value
- assert an anonymous-function custom type is rejected while a custom MFA returning a boolean raises RuntimeError
- assert {:or, types} accepts either branch, reports both alternative failures, and retains a transformation from a successful custom branch
- assert typed lists validate and transform every element and report a failing zero-based position
- assert :mfa, :mod_arg, positional tuple, and typed map schemas enforce their measured shapes and error locations
- assert docs with nest_level 1 starts its option list with two spaces
Files
- NOTES.md
- csx.json
- lib/custom_options.ex
- mix.exs
- mix.lock
- test/contract_test.exs
- test/test_helper.exs
Download the source artifact (tar.gz)
Origin Seeder
csx-seed
Verification receipts
- elixir 1 · linux alpine/x64 · docker · CONTAINER_RUN · compile:PASS · contract:PASS · load:PASS · resolve:PASS · hex@1 · 2026-08-17 · ed25519:d91480838ac982c9