Skip to content

Follow OverPy argument shifting for omitted defaulted middle arguments #392

Description

@e54-bot

Goal

opy-rs binds an omitted defaulted middle argument the way the pinned OverPy 9.7.10 does, so the compiled output converges on the reference for createBeam, getPlayersInRadius, createHomingProjectile and createProjectileEffect.

Context

The owner decided to follow the upstream behavior and supersede the approved exception recorded in #366 ("Optional or defaulted middle argument omitted" in docs/architecture/language-core.md, pinned by structural_convergence::an_omitted_optional_argument_does_not_shift_the_rest, gap reference-binds-mistyped-optional in probe-gaps.json). The reference shifts the remaining arguments left without type checking and writes a mistyped call; opy-rs currently rejects with missing-argument.

Found while implementing #385 (PR #390), which keeps createHomingProjectile and createProjectileEffect in the existing gap.

Two mechanisms are involved:

  • createBeam (2 probes): the opy-rs binder reports missing-argument. After shifting, reevaluation has no default, so the reference writes a 5-argument call. This is an opy-rs binder change.
  • getPlayersInRadius (2), createHomingProjectile (6), createProjectileEffect (2): opy-rs accepts none of these after shifting because workshop_rs::validate::validate_canonical_ids (called at crates/opy-rs/src/compiler/mod.rs) rejects the mistyped shifted arguments (for example argument 17 must have semantic type 'Player', got Number). It validates the whole program with no per-call opt-out. The same rule backs the other approved exceptions in language-core.md that cite workshop-rs ADR-0014.

Scope

  • Decide with workshop-rs how canonical validation admits the reference's mistyped shifted calls (per-call allowance or validation mode). workshop-rs owns that policy; opy-rs must not skip validation for the whole program or special-case names.
  • Then change the opy-rs binder to shift omitted defaulted middle arguments for the four functions.
  • Remove the gap entry and the language-core.md exception row; update the pinning test to expect the reference's output.

Non-goals

  • Weakening canonical validation for any other case.
  • Adding workshop-rs catalog entries.

Acceptance criteria

  • The four functions compile omitted-middle-argument calls with output structurally equal to the pinned OverPy.
  • probe-gaps.json no longer lists reference-binds-mistyped-optional; probe_builtins.py reports no unexplained difference for them.
  • #366 exception documentation is removed or replaced with the new contract.
  • Standard gates pass.

Dependencies

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions