Repository navigation
feat(scripts): bind typed event handlers in TypeScript and Lua - #646
Conversation
Code review: Standards and SpecI reviewed the diff from StandardsBreaches of documented standards
Smells (judgement calls)
SpecMost claims in the description hold:
(c) Implemented, but the implementation looks wrong
(a) Missing or partial
(b) Not asked for
Not checked: Summary: Standards has 13 findings and 1 nit; the worst is the P1 use of "player" as a noun in the new public authoring API. Spec has 9 findings; the worst are the P2 cross-Package script ID clashes and the P2 legacy Lua scripts that are refused because they call on a global Generated by Claude Code |
|
Addressed in the latest commits:
Some findings describe existing contracts or required compatibility work:
The follow-up adversarial review found no blockers. Validation: 76 Bun tests, 1,566 Module unit tests, workspace Clippy and the Wasm check passed. All five durable Runtime Script tests also passed before the internal flag rename and test split; focused Host tests passed afterward. |
Runtime Script authors had to write string event names and numeric IDs in comments, and read a generic global event. The new authoring form binds a named function to a typed event in TypeScript and uses the same Event Binding in Lua:
Generate editor types and core hook dispatch from one event catalogue. Each source has one Event Binding. Login and level-up expose a required Character handle, and level-up exposes the attained
newLevel. The wrapper preserves numeric Script Answers and the existing effect staging rules.The compiler records stable IDs in
script-ids.json, preserves prior artifact and legacy IDs, and allocates unused IDs across the enabled Package Inventory for new sources. Existing directives and stored Script Artifacts remain supported. This is Package API version 2; version 1 examples retain their earlier toolchain contract. The CLI pin includes the identity digest and scaffold changes from LyraCoreProject/lyracore-cli#72. LyraCoreProject/packages#80 migrates the examples, tests the compiled Package Event through the newask_artifact_offlinePackage test helper, and publishes the matchingapi-v2collection tag.Validation: 76 Bun tests, Datascript type checking, Module unit tests, Package API lint, Package Delta tests, workspace Clippy and Wasm checks passed. All five durable Runtime Script tests passed on disposable Standalones. The typed-handler case applied the compiled Lua, awarded quest XP through core gameplay and observed
Ding 2thenDing 3. Separate adversarial standards and specification reviews passed after migration, Unicode and allocation fixes.Made with GPT-6 Astra and GPT-6.1 Sol through the Codex harness in T3 Code.