You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Runtime Scripts: compile TypeScript authoring output to Lua #320
Category: enhancement Summary: Add the Package-author TypeScript-to-Lua build path while keeping Lua as the runtime contract.
Current behavior:
The piccolo spike includes representative generated Lua, but Packages cannot build Runtime Script TypeScript or ship a reconciled artifact.
Desired behavior:
Use the pinned Bun Package toolchain and a pinned TypeScript-to-Lua configuration to compile scripts/*.ts into deterministic Lua artifacts. Hand-written Lua enters the same artifact and runtime path. Generated code targets the semantics verified by the piccolo spike and is measured against the same fuel budget. Runtime diagnostics identify the generated Lua location. Source-map support may follow later.
Key interfaces:
Runtime Script TypeScript authoring types
TypeScript-to-Lua build configuration
Package script artifact
Hand-written Lua inclusion rule
Acceptance criteria:
A typed event handler builds into Lua accepted by the Runtime Script host.
The same sources and locked tools produce byte-identical artifacts.
Hand-written Lua and generated Lua reconcile through one Package contract.
CI typechecks TypeScript and rejects stale generated Lua.
Fuel tests include representative generated code.
Operators do not need Bun to publish prebuilt Runtime Scripts.
Handoff from the #317 implementation (PR #324): piccolo 0.3.3 miscompiles f({...}) — it passes the table constructor's element count as an extra argument, so f({7,8,9}) reaches a 3-param f as f(table, 3, nil). Reproduced in the untouched spike harness, so it is the engine, not the host. Transpiled TS output leans on this call shape (x = x or default chains), so the TS→Lua build must avoid or rewrite direct table-constructor call arguments. A pinning test in module/src/runtime_script.rs fails when the engine fixes it.
PRs filed 2026-09-02: core #402 (Runtime Script authoring types, the pinned typescript-to-lua build under the Datascript Bun project, the piccolo table-constructor rewrite with a pinning test, fuel coverage for generated Lua, docs and glossary) and CLI LyraCoreProject/lyracore-cli#55 (packages build compiles packages/<name>/scripts/*.ts and includes *.lua, writes the Script Artifact plus a script.identity sidecar; packages check verifies it). Decisions made and named in the PRs: sources live inside the Package folder; @id is author-written; each script compiles as its own program. Byte-identical rebuilds were verified by hand. The end-to-end run through the ./lyracore shim waits for the pin bump after the CLI PR merges. Orchestrated by Claude (model claude-fable-5-1) via Claude Code.
Merged 2026-09-03: core PR 402 (authoring types, pinned typescript-to-lua build under the Datascript Bun project, piccolo call-shape rewrite with a pinning test, fuel coverage) and CLI PR 55 (packages build compiles scripts/*.ts, includes *.lua, writes the Script Artifact and its Build Identity; packages check verifies it), pinned by core PR 406. Byte-identical rebuilds verified; Operators install prebuilt artifacts and need no Bun.
Activity
Mathih13 commentedon Aug 24, 2026
Handoff from the #317 implementation (PR #324): piccolo 0.3.3 miscompiles
f({...})— it passes the table constructor's element count as an extra argument, sof({7,8,9})reaches a 3-paramfasf(table, 3, nil). Reproduced in the untouched spike harness, so it is the engine, not the host. Transpiled TS output leans on this call shape (x = x or defaultchains), so the TS→Lua build must avoid or rewrite direct table-constructor call arguments. A pinning test inmodule/src/runtime_script.rsfails when the engine fixes it.Mathih13 commentedon Sep 3, 2026
PRs filed 2026-09-02: core #402 (Runtime Script authoring types, the pinned typescript-to-lua build under the Datascript Bun project, the piccolo table-constructor rewrite with a pinning test, fuel coverage for generated Lua, docs and glossary) and CLI LyraCoreProject/lyracore-cli#55 (
packages buildcompilespackages/<name>/scripts/*.tsand includes*.lua, writes the Script Artifact plus ascript.identitysidecar;packages checkverifies it). Decisions made and named in the PRs: sources live inside the Package folder;@idis author-written; each script compiles as its own program. Byte-identical rebuilds were verified by hand. The end-to-end run through the./lyracoreshim waits for the pin bump after the CLI PR merges. Orchestrated by Claude (model claude-fable-5-1) via Claude Code.Mathih13 commentedon Sep 3, 2026
Merged 2026-09-03: core PR 402 (authoring types, pinned typescript-to-lua build under the Datascript Bun project, piccolo call-shape rewrite with a pinning test, fuel coverage) and CLI PR 55 (
packages buildcompilesscripts/*.ts, includes*.lua, writes the Script Artifact and its Build Identity;packages checkverifies it), pinned by core PR 406. Byte-identical rebuilds verified; Operators install prebuilt artifacts and need no Bun.