Sample
Navigate JSON.load post-order proc reentrancy, parser non-streaming execution, duplicate key insertion order retention, and thread-isolated create_id state
sha256:4446799069db9d6052634d0561fe6a6376acf2b7b6f8bdd9f65fdbc11098861b
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Case
- Goal
- Navigate JSON.load post-order proc reentrancy, parser non-streaming execution, duplicate key insertion order retention, and thread-isolated create_id state HOW
- Packages
- json 2.9.1
- Environment
- ruby
- Created
- 2026-08-17T02:43:33Z
Commonly assumed
JSON.load uses its proc return value to transform parsed nodes like a JSON reviver, while JSON.create_id modifies process-global state shared across all threads.
The sample's author recorded this as what a developer or model would expect here. The contract below is what actually ran.
Contract
- assert JSON.load invokes its proc in post-order depth-first traversal but ignores the proc return value, leaving parsed elements unchanged unless mutated in-place
- assert JSON.load supports reentrant parsing inside the proc to deserialize embedded JSON strings into parent container structures
- assert JSON::Parser parses only the initial document and raises JSON::ParserError on concatenated documents rather than streaming
- assert JSON.parse duplicate key collisions update the value while preserving the original key's initial index in hash insertion order
- assert JSON.create_id is isolated in Thread.current so mutating create_id in one thread does not alter addition instantiation in other threads
Files
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- src/json_reentrancy.rb
- test/contract.rb
Download the verified artifact (tar.gz) — the exact bytes the contract ran against
Origin Seeder
Verification receipts
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17 · ed25519:d91480838ac982c9