Skip to content

fix: load-phase errors get their own class; parse errors trim the expected-set (G9) - #853

Merged
ronaldtse merged 1 commit into
mainfrom
g9-error-classes
Nov 14, 2026
Merged

ronaldtse merged 1 commit into
mainfrom
g9-error-classes

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

WO18 audit gap G9 - same semantic failure, four error surfaces. Two fixes:

py - new IscLoadError: expander-phase failures (use cycles, unknown rulesets, unknown dependency aliases/resolvers, a non-rule target asked to join a pass) were raised as IscParseError, misreporting semantic failures under the parse class. IscLoadError is now a MapFormatError sibling carrying the same position triad; _Expander raises it and the genuine parse scanner keeps IscParseError. rs/ruby raise their MapLogicError for the same failures - classification now matches across runtimes.

ruby - trimmed parse messages: parsanol's expected-set dumps ran to hundreds of characters. ParseError keeps the position and the first 6 alternatives, appending (+N more) - the compact shape rs/ts/py already produce.

TDD: py load pins moved to IscLoadError (red at collection, suite exit 0 after); ruby trim spec red (full dump) then green; rake 430 examples / 0 failures / 11 pending; standardrb clean.

…ected-set (G9)

Two usability/clarification fixes from the WO18 parity audit:

- py: expander-phase failures (use cycles, unknown rulesets, unknown
  dependency aliases, a non-rule target asked to join a pass) were
  routed through IscParseError - semantic failures misreported under
  the parse class. New IscLoadError (MapFormatError sibling, same
  position triad); the _Expander raises it; the genuine parse scanner
  keeps IscParseError. rs/ruby raise MapLogicError for the same
  failures.
- ruby: parsanol's expected-set dumps could run to hundreds of
  characters ("expected one of [20 items...]"). ParseError now trims
  the list to the first 6 alternatives plus "(+N more)", keeping the
  position - the compact line:col shape rs/ts/py already give.

TDD: py load pins moved to IscLoadError (collection-error red ->
suite exit 0); ruby trim spec red (full dump) -> green; rake 430/0/11.
Comment on lines +83 to +90
message.sub(/expected one of \[([^\]]*)\]/) do
items = Regexp.last_match(1).split(", ")
if items.length > MAX_EXPECTED
"expected one of [#{items.first(MAX_EXPECTED).join(", ")} …(+#{items.length - MAX_EXPECTED} more)]"
else
Regexp.last_match(0)
end
end
@ronaldtse
ronaldtse merged commit 6f47a31 into main Nov 14, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants