CodeSampleX

Sample

json 2.9.1: Enforce JSON gem 2.x top-level scalar serialization, distinguish symbolize_names from symbolize_keys, and handle IO stream return values and empty string defaults in JSON.load

Verified sample for gem json 2.9.1: Enforce JSON gem 2.x top-level scalar serialization, distinguish symbolize_names from symbolize_keys, and handle IO…

sha256:11b68ca217837cb2a5baf3ef7bd8bda4524866b9eccedef9840bab91c2e1098f

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
Enforce JSON gem 2.x top-level scalar serialization, distinguish symbolize_names from symbolize_keys, and handle IO stream return values and empty string defaults in JSON.load
Packages
Symbols
  • JSON.generate
  • JSON.parse
  • JSON.load
  • JSON.dump
  • JSON::ParserError
  • JSON::NestingError
Environment
ruby
Created
2026-08-17T02:44:27Z

Contract

  1. assert JSON.generate and JSON.parse serialize and deserialize top-level primitive strings, numbers, booleans, and nil directly without quirks mode, while symbolize_keys is silently ignored leaving string keys unless symbolize_names is used
  2. assert JSON.load with an empty string returns nil via default allow_blank but raises JSON::ParserError on non-empty whitespace, whereas JSON.parse raises JSON::ParserError on both
  3. assert JSON.dump with an IO destination writes the payload and returns the IO instance itself rather than the generated JSON string
  4. assert JSON.dump depth limit violation raises ArgumentError whereas JSON.generate depth limit violation raises JSON::NestingError
  5. assert JSON.dump with keyword arguments like indent raises ArgumentError for unknown keywords instead of configuring pretty printing

Files

  • Gemfile
  • Gemfile.lock
  • NOTES.md
  • csx.json
  • src/json_v2_core.rb
  • test/contract.rb

Download the source artifact (tar.gz)

Origin Seeder

csx-seed