CodeSampleX

Sample

mustermann 4.0.0: Extract route parameters incrementally using peek_params and compose patterns safely using safe_string and the plus operator

Verified sample for gem mustermann 4.0.0: Extract route parameters incrementally using peek_params and compose patterns safely using safe_string and the plus…

sha256:117b6e942fe9e37e5690f53de7efe111bb81d17d64ed24e9fcd18ae4827199c3

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

Verification-run environments

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

Case

HOW
Goal
Extract route parameters incrementally using peek_params and compose patterns safely using safe_string and the plus operator
Packages
Symbols
  • Mustermann
  • Mustermann.new
  • Mustermann::Pattern#peek_params
  • Mustermann::Pattern#safe_string
  • Mustermann::Pattern#+
Environment
ruby
Created
2026-08-17T07:28:24Z

Contract

  1. Mustermann patterns anchored to string boundaries return nil on subpaths when using match or params, but peek_params performs unanchored prefix matching and returns both extracted params and the consumed character offset for stepwise sub-routing.
  2. Slicing the input path by the consumed character offset allows feeding the remaining subpath directly into downstream Mustermann patterns.
  3. Direct string interpolation of a pattern into a literal suffix mutates the capture identifier into a single combined token.
  4. Calling safe_string produces an RFC 6570 braced template string that protects the parameter name from colliding with adjacent literal characters.
  5. Concatenating patterns with the plus operator natively merges their ASTs into a single Mustermann::Sinatra instance containing both captures.

Files

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

Download the source artifact (tar.gz)

Origin Seeder

csx-seed