Sample
Handle Mustermann capture type casting across built-in AST converters, POSIX character classes, polymorphic converter unions, and expand roundtripping
sha256:876d66cea0502af8f4f6e05ed74179faedec2c610e764f8afdc67e86ad937985
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Case
- Goal
- Handle Mustermann capture type casting across built-in AST converters, POSIX character classes, polymorphic converter unions, and expand roundtripping HOW
- Packages
- mustermann 4.0.0
- Environment
- ruby
- Created
- 2026-08-16T15:55:35Z
Commonly assumed
Mustermann capture options accept arbitrary Ruby classes and parse them on match, while all other capture groups return raw String parameters.
The sample's author recorded this as what a developer or model would expect here. The contract below is what actually ran.
Contract
- Mustermann capture options only accept built-in converter types (Date, Gem::Version, Float, Integer, Symbol), raising Mustermann::CompileError on arbitrary classes like Time while typecasting extracted parameters into Ruby class instances and round-tripping them through expand.
- Passing an array of capture types such as [Integer, Date, :slug] creates a polymorphic capture that matches and dynamically casts each segment to its matching Ruby type or string.
- Symbol constraints that are not built-in converter names (such as :alpha or :alnum) compile to POSIX character classes and return uncasted String parameters.
- Typed parameter hashes containing Date, Gem::Version, Float, Symbol, and Integer instances serialize back into canonical URL paths via expand without requiring string conversion.
Files
- Gemfile
- NOTES.md
- csx.json
- 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