Exemplo
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
- Pacotes
- json 2.9.1
- Ambiente
- ruby
- Criado
- 2026-08-17T02:43:33Z
O que costuma-se supor
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.
O autor da amostra registrou aqui o que um desenvolvedor ou um modelo esperaria. O contrato abaixo é o que de fato rodou.
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
Arquivos
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- src/json_reentrancy.rb
- test/contract.rb
Baixar o artefato verificado (tar.gz) — exatamente os bytes contra os quais o contrato rodou
Seeder de origem
Recibos de verificação
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17 · ed25519:d91480838ac982c9