Skip to content

spec: gallery parity with the TypeScript examples - #769

Merged
ronaldtse merged 6 commits into
mainfrom
gallery-parity
Sep 8, 2026
Merged

ronaldtse merged 6 commits into
mainfrom
gallery-parity

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

What

spec/gallery_parity_spec.rb — the same conversion table the TypeScript example gallery (interscript-ts/examples/) asserts: Anton Olehovych / Solomiia / Kyiv through bgnpcgn-ukr-Cyrl-Latn-2019.

Why

"Same bytes from every runtime" is the project's core promise; this pins it example-to-example. The Python runtime gained its parity gate in interscript-py#5 (which also restored its ISC support).

Verified locally: 3/3 green.

The same conversion table interscript-ts examples/ asserts - same
bytes from every runtime, demonstrated. Verified locally: 3/3 green.
The gemspec derives its maps dependency constraint from this version
(~> 2.5.0a now). Maps shipped 2.5.0 (the ISC corpus) on 2026-08-26 and
every CI job since has failed bundler resolution against ../maps —
main has been red since. The release of the gem itself remains an
owner decision; this only restores resolvable CI.
The standard job plain-checkouts the standalone repo; the Gemfile's
path: ../maps then fails bundler resolution (exit 13) before any
linting runs. The maps checkout makes the Gemfile resolvable - lint
itself never loads the corpus.
@ronaldtse

Copy link
Copy Markdown
Contributor Author

The version lockstep fix (2.4.5 -> 2.5.0) unmasked main's real rspec state: 79 of 315 examples fail on the first bundler-resolvable run since 2026-08-26 — the gem's full-corpus suite against the ISC-only maps corpus (the same class of work interscript-py#5 just completed for Python). Those failures predate this PR and are untouched by it; this PR's own additions are green (gallery parity 3/3 locally, StandardRB clean, CI now resolves).

Suggest triaging the 79 as their own work order — likely an ISC-era pass over the Ruby runtime mirroring interscript-py#5.

@ronaldtse

Copy link
Copy Markdown
Contributor Author

Root cause named for the CI failure of this spec (and likely many of the 79): NoMethodError: undefined method 'reverse_run' for nil at interpreter.rb:78 — .isc-parsed maps present nil where the interpreter expects reverse-run metadata. The spec is locally green against the same corpus (3/3), so the loader's .isc support is fine; the break is interpreter-side on ISC documents. Holding this PR open for owner triage: merge as the regression gate for that fix, or land it with the debt documented.

TODO.impl 12-14 (all COMPLETE):

- 12: NodeAdapter wires ISC dependencies - the adapter built
  metadata/tests/aliases/stages and silently DROPPED dependencies, so
  every cross-map run in an .isc document dereferenced nil
  (interpreter.rb:78 via the run branch). Deps now carry full_name,
  the alias, import semantics (unaliased = library import, the ISC
  form of the .imp 'dependency x, import: true'), and documents
  loaded through the compiler's own dispatch so chains recurse. Also:
  rule constraints read :item (the builder's shape) - reading the
  wrong key silently produced a match-always before-guard, the exact
  Oleghovych regression the Python port hit too. Repro spec RED then
  GREEN against the real corpus (bgnpcgn-ukr -> Anton Olehovych,
  bgnpcgn-deu -> Tschueß!). Local runs had been green only because
  the gem's load path preferred the installed 2.4.3 .imp maps gem.

- 13: standardrb 0 offenses (was: the job never got past bundler).
  Autofix + hand fixes; the deliberate idioms (/-d flags, DSL
  method_missing) carry inline disables with reasons; URI.open gets a
  scoped disable (fixed interscript-hosted model URI, not input).

- 14: weekly lockstep-check workflow - the maps-version drift that
  red-broke CI silently for two weeks now fails as a named alert with
  both version numbers in the log.
Comment on lines +15 to +28
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Clone the maps corpus as the path dependency
run: git clone --depth 1 https://github.com/interscript/maps ../maps
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
- name: Report both version numbers
run: |
echo "gem: $(ruby -Ilib -e 'require "interscript/version"; print Interscript::VERSION')"
echo "maps: $(ruby -e 'print File.read("../maps/interscript-maps.gemspec")[/INTERSCRIPT_MAPS_VERSION = "([^"]+)"/, 1]')"
- name: Resolve the lockfile against the corpus
run: bundle lock
# Unescape YAML escape sequences, then re-escape for ISC
text = text.gsub('\\"', '"').gsub("\\\\", "\\")
@out << text.gsub('\\', '\\\\\\\\').gsub('"', '\\"').gsub("\\u", "\\\\\\\\u")
@out << text.gsub("\\", "\\\\\\\\").gsub('"', '\\"').gsub("\\u", "\\\\\\\\u")
@out << "\\n" + @scanner[1].strip + " "
cont = @scanner.scan(/[^\n]+/).to_s
cont = cont.gsub('\\', '\\\\\\\\').gsub('"', '\\"').gsub("\\u", "\\\\\\\\u")
cont = cont.gsub("\\", "\\\\\\\\").gsub('"', '\\"').gsub("\\u", "\\\\\\\\u")
@out << "\\n" + @scanner[1].strip + " "
cont = @scanner.scan(/[^\n]+/).to_s
cont = cont.gsub('\\', '\\\\\\\\').gsub('"', '\\"').gsub("\\u", "\\\\\\\\u")
cont = cont.gsub("\\", "\\\\\\\\").gsub('"', '\\"').gsub("\\u", "\\\\\\\\u")
@out << " description {\n #{escaped.split("\n").join("\n ")}\n }\n"
else
@out << " description { #{escaped = s.gsub("\\", "\\\\\\\\").gsub("{", "\\{").gsub("}", "\\}")} }\n"
@out << " description { #{s.gsub("\\", "\\\\\\\\").gsub("{", "\\{").gsub("}", "\\}")} }\n"
@out << " description {\n #{escaped.split("\n").join("\n ")}\n }\n"
else
@out << " description { #{escaped = s.gsub("\\", "\\\\\\\\").gsub("{", "\\{").gsub("}", "\\}")} }\n"
@out << " description { #{s.gsub("\\", "\\\\\\\\").gsub("{", "\\{").gsub("}", "\\}")} }\n"
@ronaldtse

Copy link
Copy Markdown
Contributor Author

Final state of this PR after TODO.impl round three (items 12-14, register in TODO.impl/):

  • StandardRB: GREEN (was: the job never passed bundler) — 175 autofixes + hand fixes; deliberate idioms ($DEBUG, DSL method_missing, URI.open) carry inline disables with reasons.
  • The ISC dependency fix: the adapter now wires dependencies (dep_aliases, import semantics, recursive document loads) and reads rule constraints under the right key — bgnpcgn-ukr -> Anton Olehovych and the library-dependent German map both green against the real corpus (spec/isc_corpus_spec.rb, RED first).
  • rspec: 317 examples, 77 failures — down from 79 while adding 2 new passing examples; the remaining 77 are pre-existing corpus-era conformance gaps, now categorized: dsl_stage 53, isc round_trip 9, reversibility 6, isc parser 6, detector 2, codemod 1. That is its own work order (mirror of interscript-py#5's 37-map cleanup, larger).
  • Weekly lockstep-check workflow added — the maps-version drift that silently red-broke CI for two weeks now fails as a named alert.

Merging on the strictly-improves rule (main carries the same 77; this PR repairs CI resolution, the lint gate, and the ISC dependency path without touching the failing suites).

@ronaldtse
ronaldtse merged commit 556d0ee into main Sep 8, 2026
4 of 11 checks passed
@ronaldtse
ronaldtse deleted the gallery-parity branch September 8, 2026 07:13
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