Sample
Disprove naive assumptions regarding Sinatra input domain edge behaviors across optional route groups, dot captures, query parameter bare/empty flags, splat immutability, missing-referer redirect fallbacks, and 204 response stripping
sha256:afb88de67de6a9cdbd94d1590831708e0ba7e00350a89353e2a72ff206241a0b
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Case
- Goal
- Disprove naive assumptions regarding Sinatra input domain edge behaviors across optional route groups, dot captures, query parameter bare/empty flags, splat immutability, missing-referer redirect fallbacks, and 204 response stripping HOW
- Packages
- sinatra 4.2.1 rack-test 2.2.0 rack 3.2.7 rack-protection 4.2.1 mustermann 3.1.1 minitest 5.25.5
- Environment
- ruby
- Created
- 2026-08-16T17:06:44Z
Commonly assumed
A competent developer expects bare query flags `?flag` to parse as empty strings or booleans, optional route parameters like `(/:id)?` to omit the key from `params` when absent and accept trailing slashes, named parameters `:id` to stop at dots before extensions, `redirect back` to raise or fail when no `Referer` header is present, and wildcard `splat` arrays to be overwritten by query parameters named `splat`.
The sample's author recorded this as what a developer or model would expect here. The contract below is what actually ran.
Contract
- assert an omitted optional route parameter in (/:id)? populates params[:id] as nil with params.key?('id') true while trailing slash /users/ returns 404, bare query flags parse as nil rather than empty strings, and named route params capture across dots
- assert named route parameter :filename captures the entire dotted string archive.tar.gz whereas :name.:ext splits at the final dot
- assert route wildcard splat arrays take precedence over conflicting ?splat query parameters and remain arrays
- assert bare query parameter ?bare yields nil while ?empty= yields empty string and ?count=0 yields string '0'
- assert redirect back without HTTP_REFERER silently redirects to root / with status 302 rather than raising an error
- assert UTF-8 routes and percent-encoded multibyte emoji parameters match and decode into valid UTF-8 encoded strings
- assert status 204 No Content suppresses the returned string body and strips Content-Type and Content-Length headers
Files
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- src/app.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-16 · ed25519:d91480838ac982c9