Repository navigation
chore: export the control surface for the engine contract - #59
Merged
Merged
Conversation
Add tools/control_surface.rb, the ruflet-owned export of every DSL name the control factory resolves and every service: its wire type, the keywords it accepts, whether it is the canonical name of its wire type (alias_of otherwise), and per wire type the union of keywords of every class sending it. The engine's control-core contract test compares each shared core spec with this union; the template's conformance check can read the same file. Contract version 2 of the template's surface format.
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.
What
Adds
tools/control_surface.rb, the ruflet-owned export of the Ruby control surface (lead decision DC-8: the ruflet repo owns the generator; the engine and the template consume its JSON). It is the input of the engine's new control-core contract test, rule C3 ("each shared core spec declares exactly what Ruby can send").Engine counterpart: AdamMusa/ruflet-engine#81 (
refactor/control-core-foundation). The engine checks in a copy produced by this tool and refreshes it withpackages/ruflet/tool/sync_ruby_surface.rb --ruby <ruflet checkout>; engine CI never needs a ruflet checkout.Usage
Output (contract version 2)
Same entry format as the template's
generate_ruflet_control_surface.rb(v1), plus:canonical(true/false) andalias_of(the canonical DSL name of its wire type:cupertino_switch->switch,alertdialog->alert_dialog);wire_types: per wire type its canonical name, family, DSL names and the union of keywords of every class that sends it (what the engine compares a spec with);common_attributes: the factory-wide wire attributes (flip,transform;refstays in Ruby);summary.canonical_entries.Deliberate differences from the template's v1 data (both make the export match what
ControlFactory.buildactually does):Controls::RufletControls::CLASS_MAPswitchreports the union contract class and contract-only names (picker,timer_picker,action_sheet,context_menu_action,elevated_button+ spellings) are listed: 348 -> 359 visual entriesKEYWORDSor[]ControlFactory.constructor_keywords(+ATTRIBUTE_OVERRIDES), so classes without aKEYWORDSconstant (e.g.RadioGroup) list their real keywordsThe template's conformance test hard-codes the v1 counts (386/348/38/205); switching the template to this file is the integrator's job (D-5) and needs those counts updated (397/359/38/205).
Tests
packages/ruflet_core/test/control_surface_export_test.rb(runs in CI with the rest of ruflet_core): every factory name is exported; entries name the class the factory builds; aliases point at the canonical name of the same wire type; wire-type unions; classes withoutKEYWORDS;--out/--checkround trip and stale detection.Verified with
team/verify_pr.sh "" <this worktree>(RUBY_PKGS="ruflet_core ruflet ruflet_server ruflet_rails"): ruflet_core 146/146 files (639 runs), ruflet 13/13, ruflet_server 11/11, ruflet_rails 15/15. PASS. No library code changes; mruby is not involved (CRuby tool only).Dependencies
None. New files only.