Skip to content

Runtime Scripts: embed piccolo with fuel and staged effects #317

Closed

Description

@Mathih13

This was generated by AI during triage.

Agent Brief

Category: enhancement
Summary: Add the contained Lua execution host and its failure boundary.

Current behavior:
Core has hook registries but no Runtime Script interpreter. The completed piccolo spike proves the chosen engine can run in the Module target.

Desired behavior:
Embed a pinned piccolo version behind one Runtime Script host interface. Cache compiled code only. Every invocation gets a fresh environment and a hard fuel budget. Host operations accumulate as staged effects. A successful invocation commits them through core gameplay operations. A syntax, runtime, or fuel failure discards every staged effect, records a bounded diagnostic, and lets the core tick and other Runtime Scripts continue.

Key interfaces:

  • Runtime Script compiler cache
  • Fresh invocation environment
  • Fuel budget
  • Staged-effect result

Acceptance criteria:

  • Valid Lua compiles once and can run in multiple fresh invocations.
  • Globals written in one invocation are absent from the next.
  • An infinite loop exhausts fuel without stalling the tick.
  • Any failure discards all effects staged by that invocation.
  • A failed Runtime Script does not prevent later Runtime Scripts or core processing.
  • Diagnostics identify script identity, event, and failure kind without unbounded output.

Out of scope:

  • Persistent Lua globals
  • Package reconciliation and event bindings
  • A broad gameplay host API

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 27, 2026

    @Mathih13
    ContributorAuthor

    This was generated by AI during triage.

    Verifiably shipped by PR #324 (feat/317-runtime-script-host, merged 2026-08-24), module/src/runtime_script.rs on main. Acceptance criteria check out in code: compile cache keyed by BLAKE3 source hash, fresh per-invocation environment, FUEL_BUDGET_PER_INVOCATION = 200_000, staged effects committing only on success, run_event as the failure boundary (one bad script cannot stop the next or the core tick), re-entry refused rather than panicking (tested), and the fixed-stream getrandom backend keeping replicated Shards deterministic.

    The deliberately deferred remainders are already recorded as handoff comments on their owning issues: production caller + cache lifecycle (#318), stdlib allowlist + guid representation (#319), TSTL-vs-piccolo generated-code shape (#320).

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