CodeSampleX

Sample

sinatra 4.2.1: Sinatra 4 removes the IndifferentHash initializer that merged a hash argument, silently producing an empty hash with the argument as the default value instead

Verified sample for gem sinatra 4.2.1: Sinatra 4 removes the IndifferentHash initializer that merged a hash argument, silently producing an empty hash with…

sha256:505354b2db0a9e15b3c1720605ee174c820a6c6345acea3e8f620bc078351ab0

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
1
Declared environment ruby linux x64 ruby ruby bundler

Verification-run environments

Environment Contract Stages Run
ruby 3 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · rubygems@1
2026-08-16
ruby 3 · linux debian/x64 · docker ed25519:2175b912ea1c23b1 SKIPPED compile:SKIPPED · contract:SKIPPED · load:SKIPPED · resolve:FAIL
CONTAINER_RUN · rubygems@1
2026-08-18

Case

HOW
Goal
Sinatra 4 removes the IndifferentHash initializer that merged a hash argument, silently producing an empty hash with the argument as the default value instead
Packages
Symbols
  • Sinatra::IndifferentHash
  • Sinatra::IndifferentHash.new
  • Rack::Protection::EncryptedCookie
Environment
ruby
Created
2026-08-16T17:07:41Z

Contract

  1. Sinatra::IndifferentHash.new({"role" => "admin", "id" => 7}) returns an empty hash of size 0 whose default value is the argument object, so ih["role"] returns the original seed hash rather than "admin" — the constructor no longer merges its argument in Sinatra 4
  2. ih.size == 0
  3. ih["role"] == seed_hash (returns default, not the value)
  4. ih[:role] == seed_hash (symbol access also returns the default)
  5. require 'rack/protection/encrypted_cookie' raises LoadError — EncryptedCookie was removed from rack-protection 4.x
  6. Rack::Protection.constants does not include :EncryptedCookie
  7. Sinatra::IndifferentHash['role', 'admin', 'id', 7] still populates the hash correctly — only .new(hash) is broken

Files

  • Gemfile
  • NOTES.md
  • app.rb
  • csx.json
  • test/contract.rb

Download the source artifact (tar.gz)

Origin Seeder

csx-seed