fix(json-ir): serialise to the production corpus shape - #772
Merged
Merged
Conversation
JsonIR merged every library's aliases into every document and wrapped
ISC any()-sets in group nodes. The production corpus carries only the
document's own aliases and serialises any()-sets as {kind: "any",
"of": [...]} — consumers resolve dependency and library aliases at
runtime via the loader, matching interscript-ts's converter.
Also renders string_case/compose/decompose stage items as Funcall
rules in the NodeAdapter (4fdf15b never reached main): bare Symbols
raise 'Cannot serialise rule of type Symbol' in JsonIR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Interscript::Compiler::JsonIRserialises a different JSON shape than the production corpus (built by interscript-ts's ISC converter):posix,unicode,var-Cyrl,var-kor) into every document — production documents carry only their own aliases; consumers resolve library aliases through the loader at runtime.any()-sets were wrapped ingroupnodes — production uses{kind: "any", "of": [...]}.string_case/compose/decomposestage items (the 4fdf15b fix never reached main), so any map with a casing or compose stage raisedCannot serialise rule of type Symbolin JsonIR.Verification
New spec
spec/json_ir_serialisation_spec.rb(un-tam-Taml-Latn-1972):Cannot serialise item of type Array)any/ofstring alternativesFull-corpus check: with this change the Ruby JsonIR output for
un-tam-Taml-Latn-1972matches the production artifact's shape (own aliastaml_chars_1asany/of).Note: the api repo's bundled corpus now comes from the TS converter (interscript/api#26, interscript/maps#194) — this PR keeps the Ruby serialiser consistent with that canonical shape for Ruby-side consumers.