You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
NameError: uninitialized constant Node::Item::CaptureRef on ref(N) in from position (parse crash) #864
Expected: either a named parse-time rejection ("ref() is not valid in from position") or at minimum the intended MapLogicError — not a NameError constant-lookup crash.
(The runtime-side question — what ref in from SHOULD mean — is tracked cross-runtime in the maps fuzz triage; this issue is only about the accidental crash.)
Fixed by #866 (branch wo20-fix-ruby off origin/main).
Red -> green evidence:
Pre-fix: the campaign's 9-line repro raises NameError: uninitialized constant Interscript::Node::Item::CaptureRef - reproducible both in-process and in a fresh process.
Root cause: the class exists (defined in lib/interscript/node/item/capture.rb, next to CaptureGroup) but node/item.rb had no autoload :CaptureRef entry - the constant only resolved when some earlier dependency parse referenced CaptureGroup first (which loads the file and defines both). The 27 corpus maps with to-position ref() parse today only by that accident; a to-only map crashes the same way (probed during triage).
Fix: the missing autoload entry, plus a named parse-time rejection for the invalid flavor: a ref(N) whose capture group the from expression never opens raises Interscript::MapLogicError: ref(1) in from position has no matching capture group - the WO18 G8 fn-literal-in-from convention (a named error, never an accidental exception; with the autoload alone this surface would still die at compile with an accidental RegexpError: invalid backref number/name).
Scoping: the pairing gate is count-based because Onigmo accepts any existing group number from any position - so the legal geminate idiom from capture(any_character) + ref(1) (pinned executable by node_adapter_spec, чч -> ч) keeps working, and to-position refs are untouched. Whether unpaired refs should instead be a run-time error like ts/py/rs remains the owner-held cross-runtime question from the triage.
Gates: full rake spec 438 examples / 0 failures; standardrb clean on touched files; all 428 corpus maps + 7 libs parse with byte-identical outcomes pre/post (parse-all diff against a pristine 4c47eb5 worktree).
Activity
ronaldtse commentedon Nov 16, 2026
Fixed by #866 (branch
wo20-fix-rubyofforigin/main).Red -> green evidence:
NameError: uninitialized constant Interscript::Node::Item::CaptureRef- reproducible both in-process and in a fresh process.lib/interscript/node/item/capture.rb, next toCaptureGroup) butnode/item.rbhad noautoload :CaptureRefentry - the constant only resolved when some earlier dependency parse referencedCaptureGroupfirst (which loads the file and defines both). The 27 corpus maps withto-positionref()parse today only by that accident; ato-only map crashes the same way (probed during triage).ref(N)whose capture group the from expression never opens raisesInterscript::MapLogicError: ref(1) in from position has no matching capture group- the WO18 G8 fn-literal-in-from convention (a named error, never an accidental exception; with the autoload alone this surface would still die at compile with an accidentalRegexpError: invalid backref number/name).from capture(any_character) + ref(1)(pinned executable bynode_adapter_spec,чч->ч) keeps working, andto-position refs are untouched. Whether unpaired refs should instead be a run-time error like ts/py/rs remains the owner-held cross-runtime question from the triage.rake spec438 examples / 0 failures;standardrbclean on touched files; all 428 corpus maps + 7 libs parse with byte-identical outcomes pre/post (parse-all diff against a pristine4c47eb5worktree).