Skip to content

fix(emitter)!: emit constant wrappers and yes/no settings the way the client accepts them - #303

Merged
Teakowa merged 4 commits into
mainfrom
feat/wrapper-forms-302
Sep 26, 2026
Merged

Teakowa merged 4 commits into
mainfrom
feat/wrapper-forms-302

Conversation

@e54-bot

@e54-bot e54-bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Fixes #302

Rule

Keyed on the constant's domain, identical for every emit path and locale (docs/wrapper-forms.md): Hero/Button/Color/Map always wrapped, Team members bare. Evidence: pinned OverPy 9.7.10 probe in en-US and zh-CN across Team-, Hero-, Array-, Compare- and Custom String-argument positions (ADR-0014 "deliberate upstream emission rule").

Changes

  • Emitter: one wrapper rule; removes the force_hero_constructors conversion-only path and the locale-dependent Hero wrapping.
  • Settings: new KeyKind::YesNo for Allow Players Who Are In Queue and Swap Teams After Match; adds the Yes token (from the __yes__ export entry).
  • Catalog: the ten zh-CN action spellings now emit the OverPy spelling first; old spelling stays a parse alias. Digest and pin updated.
  • Tests: table round-trip in en-US and zh-CN, settings words, ten spellings, and wrapper-count/no-new-token check on the OverPy-generated fixtures (ai-pve, bastion). Two corpus test inputs updated to the new forms.

Notes

  • Game Mode(...) is a catalog value function and is preserved as parsed; not part of the wrapper rule.
  • Client acceptance is not verified here; the rule relies on OverPy's production forms.
  • Breaking emission change: bare Hero/Button and Team(...) are no longer written.

Validation

fmt, clippy -D warnings, cargo test --workspace --all-targets, workshop-catalog-gen check, git diff --check all pass locally.

… client accepts them

Hero, Button, Color and Map constants are always written with their wrapper and Team members bare, in every position, emit path and locale, matching pinned OverPy 9.7.10. Lobby settings that take yes/no are written Yes/No. The ten zh-CN action spellings that differed from OverPy now emit the OverPy spelling and keep the old one as a parse alias. Adds docs/wrapper-forms.md and regression coverage.

Fixes #302

@Teakowa Teakowa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One blocking test-coverage issue.

Comment thread crates/workshop-rs/tests/wrapper_forms.rs Outdated
The fixture regression filtered on non-existent case ids and matched nothing. It now selects ai-pve and bastion and fails if either is missing. Exercising it showed the pinned OverPy spelling Domina was not the emitted hero alias.

@Teakowa Teakowa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The zero-case bug is fixed and CI is green, but the fixture AC is now being narrowed in the test.

Comment thread crates/workshop-rs/tests/wrapper_forms.rs Outdated
Restores the whole-fixture no-added-token check. Settings numbers keep their shortest spelling, hero settings prefer the producer alias, and indexed player-variable actions split the player and name pair again.

@Teakowa Teakowa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Teakowa
Teakowa merged commit 843e8ac into main Sep 26, 2026
5 checks passed
@Teakowa
Teakowa deleted the feat/wrapper-forms-302 branch September 26, 2026 09:34
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.

Emit constant wrappers and settings values the way the client accepts them

2 participants