Sample
json 2.9.1: Distinguish JSON.parse! relaxed parsing from JSON.parse strict limits, load explicit json/add core additions for bidirectional serialization, and forward generator State through custom to_json methods
Verified sample for gem json 2.9.1: Distinguish JSON.parse! relaxed parsing from JSON.parse strict limits, load explicit json/add core additions for…
sha256:bc062acc906536678976cf1c339f352acd1b7ab93a8126083d2e995f58c8816b
This network offers one thing: a sample that builds. It ran the sample in a sandbox and kept the signed receipt. It grades nothing and warrants nothing — whether the same code builds where you are is not something it measured.
How many distinct signing keys filed a passing contract receipt. One is the author alone; more than one means somebody else built it too. A key is self-generated with nothing registered behind it, so it counts keys, not people.
MIT-0
Execution evidence
The declared environment and the signed runs are kept apart, so you can see exactly what this sample ran and where.
- Evidence basis
- Signed contract pass
- Verification receipts
- 2
- Signing keys that built it
- 2
Declared environment
ruby linux x64 ruby ruby rubygems
Verification-run environments
| Environment | Contract | Stages | Run |
|---|---|---|---|
| ruby 3 · linux debian/x64 · docker ed25519:d91480838ac982c9 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · rubygems@1 |
2026-08-17 |
| ruby 3 · linux debian/x64 · docker ed25519:2175b912ea1c23b1 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · rubygems@1 |
2026-08-18 |
Case
HOW- Goal
- Distinguish JSON.parse! relaxed parsing from JSON.parse strict limits, load explicit json/add core additions for bidirectional serialization, and forward generator State through custom to_json methods
- Packages
- Symbols
-
- JSON.parse!
- JSON.parse
- JSON.generate
- JSON.pretty_generate
- JSON.fast_generate
- JSON::State
- json/add/range
- json/add/regexp
- Object#to_json
- Environment
- ruby
- Created
- 2026-08-17T02:43:07Z
Contract
- assert JSON.parse rejects NaN and nesting depths over 100 with ParserError and NestingError whereas JSON.parse! relaxes limits to allow NaN and unbounded nesting by default
- assert core types like Range, Regexp, Complex, and Rational require explicit json/add modules to serialize as json_class additions and reconstruct via create_additions
- assert JSON.generate passes a JSON::State instance to custom to_json methods raising ArgumentError on arity-zero definitions unless state arguments are forwarded
- assert JSON::State enables custom whitespace and ASCII formatting while pretty_generate formats with newlines and fast_generate bypasses depth checks
Files
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- src/json_protocol.rb
- test/contract.rb