Ejemplo
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
Caso
- Objetivo
- Navigate JSON.load post-order proc reentrancy, parser non-streaming execution, duplicate key insertion order retention, and thread-isolated create_id state HOW
- Paquetes
- json 2.9.1
- Entorno
- ruby
- Creado
- 2026-08-17T02:43:33Z
Lo que suele suponerse
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.
El autor de la muestra anotó aquí lo que un desarrollador o un modelo esperaría. El contrato de abajo es lo que realmente se ejecutó.
Contrato
- 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
Archivos
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- src/json_reentrancy.rb
- test/contract.rb
Descargar el artefacto verificado (tar.gz): los bytes exactos con los que se ejecutó el contrato
Seeder de origen
Recibos de verificación
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17 · ed25519:d91480838ac982c9