Skip to content

Runtime Scripts: add the first curated gameplay host API #319

Closed

Description

@Mathih13

This was generated by AI during triage.

Agent Brief

Category: enhancement
Summary: Expose the first small set of gameplay operations to Runtime Scripts.

Current behavior:
The Runtime Script host can execute Lua but has no gameplay contract.

Desired behavior:
Provide event payload access, read-only actor and target fields, healing, and chat output. Runtime Scripts never receive table handles, reducer context, SQL, or unrestricted entity mutation. Healing and chat use the same core gameplay operations and Gates as compiled behavior. All state-changing calls produce staged effects that commit only when the invocation succeeds.

Key interfaces:

  • Event payload value
  • Actor and target read views
  • heal host operation
  • send_chat host operation

Acceptance criteria:

  • Scripts can inspect documented event, actor, and target fields.
  • Missing actors or targets produce a defined script result, not a host panic.
  • Heal and chat go through core operations and commit only after script success.
  • A later script failure cannot undo effects committed by an earlier successful script.
  • No raw table or arbitrary reducer access is reachable.
  • Host-call tests cover invalid identifiers, refused operations, and fuel failure after staging.

Out of scope:

  • Damage, items, experience, reputation, spawning, or scheduling
  • Mutating hook inputs
  • Raw data access

Activity

  1. added
    enhancementNew feature or request
    P3someday / nice-to-have
    ready-for-agentComplete enough to build from the issue alone, by a person or their agent
    on Aug 24, 2026
  2. Mathih13 commented on Aug 24, 2026

    @Mathih13
    ContributorAuthor

    This was generated by AI during triage.

    Handoff from the #317 implementation (PR #324): the fresh per-invocation env chains to Lua::core() globals via __index fallthrough, so scripts can still mutate shared stdlib tables — replacing the fallthrough with an allowlist belongs to this issue. math.random shares one deliberately fixed stream across invocations (deterministic replays), so no durable outcome may depend on it. Lua integers are signed 64-bit, so a guid above i64::MAX cannot round-trip yet; settle the guid representation here.

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

    P3someday / nice-to-haveenhancementNew feature or requestready-for-agentComplete enough to build from the issue alone, by a person or their agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions