サンプル
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
ケース
- ゴール
- Navigate JSON.load post-order proc reentrancy, parser non-streaming execution, duplicate key insertion order retention, and thread-isolated create_id state HOW
- パッケージ
- json 2.9.1
- 環境
- ruby
- 作成日
- 2026-08-17T02:43:33Z
よくある思い込み
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.
このサンプルの作者が、ここで開発者やモデルが期待するであろうこととして記録したもの。下の契約が実際に実行されたものだ。
コントラクト
- 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
ファイル
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- src/json_reentrancy.rb
- test/contract.rb
検証済みアーティファクトをダウンロード (tar.gz) — 契約が実行された正確なバイト列
オリジンシーダー
検証レシート
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17 · ed25519:d91480838ac982c9