Skip to content

Integrate Workshop-dependent settings, locale, directive, and hook behavior #37

Description

@Teakowa

Parent: #8
Depends on: #35, #36, #52

Goal

Complete the Workshop-dependent behavior that must run after OPY semantic lowering but before the compiler can claim end-to-end compatibility.

Context

The frontend already records settings trees, translation selection, optimization/replacement directives, rule-prefix state, and the post-compile-hook declaration/runtime ABI. workshop-rs owns canonical settings validation/emission, locale mappings, WIR validation, and deterministic localized Workshop emission. This issue connects those existing contracts without duplicating their data.

This issue is the authoritative implementation issue for the backend-dependent parts of these existing matrix features; do not create A-4/A-5/A-6/A-7/A-8/A-9 duplicates:

  • semantics/settings-emission
  • preprocessing/directive-effects — only effects that survive frontend preprocessing and materially affect Workshop emission/optimization; source preprocessing such as #!define/include state is not reimplemented here.
  • hooks/post-compile-workshop
  • translations/locale-emission
  • optimization/backend-effects

optimization/emission-form is not an opy-rs-owned formatting backend. Canonical Workshop text emission remains owned by workshop-rs; #38 closes the user-visible compiler/evidence contract around that emitter. Output-text identity with OverPy is not a goal.

Scope

  • Convert OPY settings HIR into the neutral workshop-rs::settings carrier with source provenance and validate/emit through Workshop-owned tables/contracts.
  • Resolve output locale through declared workshop-rs locale/catalog coverage and make missing mappings explicit; do not embed locale spelling tables in opy-rs.
  • Define which frontend-recorded optimization/replacement/directive states have observable backend effects required for compatibility and implement only those effects with corpus/oracle evidence.
  • Preserve unsupported optimizer/output-form differences as documented non-blocking presentation differences unless observable semantics require them.
  • Apply source-level rule-prefix/presentation metadata at the correct lowering/emission boundary without changing source semantic identity.
  • Execute #!postCompileHook only after successful final Workshop emission, passing the actual emitted Workshop text to the bounded QuickJS hook ABI and using the hook completion string as the final compiler output.
  • Ensure failures in settings/catalog/locale/emission/hook stages produce structured diagnostics with the best available OPY source provenance.
  • Add minimized integration fixtures for settings, locale selection, backend directives, and post-compile hooks.

Non-goals

  • Reimplementing workshop-rs settings tables, localization corpus, WIR, or emitter.
  • Re-running frontend preprocessing such as #!define, #!undef, or include expansion in the backend.
  • Matching OverPy optimizer internals, temporary variables, or exact formatting.
  • Executing post-compile hooks against WIR, HIR, JSON, or fabricated Workshop text.
  • Workshop→OPY reconstruction ([design] Re-evaluate Workshop → OPY reconstruction scope after workshop-rs rebaseline #53 is design-only).

Acceptance criteria

  • [integration] Rebaseline opy-compiler on current workshop-rs release #52 and Lower the declared OPY semantic surface into canonical Workshop WIR #36 are complete and integration evidence uses the revalidated Workshop baseline.
  • Supported OPY settings lower through Workshop-owned validation/emission with no copied settings/catalog tables.
  • Locale selection is catalog-driven and missing mappings/fallbacks are explicit and testable.
  • Backend directive/optimizer behavior is evidence-backed and does not overclaim optimizer parity.
  • Post-compile hooks receive exactly the final emitted Workshop text and are covered by integration tests.
  • optimization/emission-form is closed through the canonical workshop-rs emitter contract plus Expose OPY compilation and close the end-to-end compatibility gate #38 end-to-end evidence, not a second OPY emitter.
  • Known Workshop-dependent gaps remain visible in the support matrix until their observable behavior is actually supported.
  • Failure paths preserve actionable structured diagnostics and do not silently fall back to guessed semantics.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions