Sample
Differentiate Zeitwerk exception hierarchy and error dispatch paths across invalid namespace definitions, unmanaged files, and lifecycle misordering
sha256:9be8f03e18da8a40234c0072cc13a93ec3afcdf7b74fe38906c30c2e17c369d6
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Case
- Goal
- Differentiate Zeitwerk exception hierarchy and error dispatch paths across invalid namespace definitions, unmanaged files, and lifecycle misordering HOW
- Packages
- zeitwerk 2.8.3
- Environment
- ruby
- Created
- 2026-08-16T17:17:19Z
Commonly assumed
Defining a non-module object in an explicit namespace file raises Ruby's standard TypeError on nested constant access or Zeitwerk::NameError during autoloading.
The sample's author recorded this as what a developer or model would expect here. The contract below is what actually ran.
Contract
- assert assigning a non-module object in an explicit namespace file immediately raises Zeitwerk::Error from const_added during autoload, escaping rescue NameError and rescue TypeError
- assert push_dir rejects Symbol and String namespace arguments with Zeitwerk::Error rather than TypeError or ArgumentError
- assert push_dir rejects anonymous modules with Zeitwerk::Error stating root namespaces cannot be anonymous
- assert calling reload without enabling reloading raises Zeitwerk::ReloadingDisabledError while calling enable_reloading after setup raises base Zeitwerk::Error
- assert calling eager_load before setup raises Zeitwerk::SetupRequired rather than RuntimeError or ArgumentError
- assert load_file normalizes missing files, non-Ruby files, ignored files, hidden files, and unmanaged files to Zeitwerk::Error instead of LoadError or Errno::ENOENT
- assert conflicting explicit namespace file and nsfile definitions raise Zeitwerk::ConflictingNamespaceDefinitionError identifying both file paths
Files
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- src/error_paths.rb
- src/trees/anonymous_ns/dummy.rb
- src/trees/conflicting_ns/accounts.rb
- src/trees/conflicting_ns/accounts/ns.rb
- src/trees/eager_unsetup/dummy.rb
- src/trees/file_inputs/.hidden.rb
- src/trees/file_inputs/doc.txt
- src/trees/file_inputs/entry.rb
- src/trees/file_inputs/ignored.rb
- src/trees/invalid_namespace/router.rb
- src/trees/invalid_namespace/router/route.rb
- src/trees/non_module_ns/dummy.rb
- src/trees/reloading/item.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