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
Confirm on a live realm that a Package's Runtime Script fires for a real event #318
Expected. A Package's Runtime Scripts should persist with a stable script_id and name, reconcile identically across every Shard, run in priority order with one failure never blocking the rest, and disappear everywhere when their Package is disabled or renamed, with no raw upload path.
Actual (at 87109e3c). Built and tested. Script (module/src/script_binding.rs#L65) carries the script_id primary key and a unique name; dispatch_order (module/src/script_binding.rs#L170) sorts priority ascending then script_id. clear_package_range and write_script (module/src/package_import/script.rs#L67) are the only writers to game_script, clearing the Package Script Range and rewriting it in one transaction, so a disabled, removed or renamed script cannot leave an orphan row. The live-DB suite module/tests/package_runtime_scripts.rs passes against a real SpacetimeDB standalone. lyracore packages replay now carries the script family to every named Shard alongside spell (lyracore-cli PR #54, merged), closing the one CLI gap earlier reviews of this issue flagged. What is still unconfirmed is a script actually firing from a real gameplay trigger on a live realm.
How to check. Install a Package that ships a Runtime Script bound to a real event, for example playerbots' personality scripts bound to its own playerbots.flee_at and playerbots.heal_at Package Events (packages/playerbots/data/.generated/personality.json). Publish, trigger the bound event through real gameplay, and confirm the script's answer takes effect. Disable the Package and confirm its scripts disappear from game_script on every Shard.
Done when. Both results are recorded here, with the realm and the commit.
Handoff from the #317 implementation (PR #324): the host ships with no caller in a default build (one narrow dead_code allow marks it). The compiler cache has no eviction — lifecycle belongs here. Re-entry through a committed effect is refused, not queued; event bindings are where that policy should actually be decided.
Batch relevance check, 2026-08-31: implemented and merged; open for live verification.
PR feat(module): reconcile Package Runtime Scripts on every Shard #358 (merged 2026-08-28) delivers every code-level acceptance criterion: game_script schema with script_id PK and unique name (module/src/script_binding.rs), reconciliation as the only writer (module/src/package_import/script.rs, clear Package Script Range then rewrite in one transaction), no raw upload reducer, priority-then-script_id dispatch order, per-script failure containment, idempotent re-publication. 64 new tests, including the live-DB suite module/tests/package_runtime_scripts.rs.
Remaining for a human on a live realm: install a Package with an on_login script and see it fire, then disable the Package and see the row and effect disappear. PR feat(module): reconcile Package Runtime Scripts on every Shard #358 named this as unrun (no SpacetimeDB credentials in its sandbox).
One wiring gap, deliberately out of the module's hands: lyracore packages replay still drives the spell family only, so realm-wide script publication currently has no CLI path (importer/src/package_delta.rs::reapply skips Script Artifacts by design). This folds into the replay-generalization follow-up issue this session files, together with the claim families items/quests/loot that shipped with the same gap.
Verification of the code half, 2026-09-02, against main 6f5f0f5.
Live-DB suite module/tests/package_runtime_scripts.rs (cargo test -p lyracore-module --test package_runtime_scripts -- --ignored --test-threads=1, own spacetime 2.7.1 standalone): 4 passed, 0 failed. One run hit a connection closed before message completed during the harness's own spacetime publish; a re-run passed, so that is the machine, not the module.
test a_conflicting_plan_leaves_the_shard_exactly_as_it_was ... ok
test a_package_binds_its_own_event_and_never_another_packages ... ok
test a_package_script_fires_on_a_real_event_and_a_failing_one_does_not_block_the_next ... ok
test a_packages_runtime_scripts_reconcile_onto_a_shard ... ok
One Package script has the same script_id, name, hash, and binding on every target Shard: Script row in module/src/script_binding.rs (script_id primary key, unique name), content hash derived at write time.
Re-publication is idempotent: clear the Package Script Range then rewrite, in one reducer transaction (package_import/script.rs); the live test re-applies the same plan and asserts identical rows.
Disabling or removing a Package removes its scripts from every target: an apply is the whole enabled plan, so a Package outside the plan leaves the table.
Renaming or deleting a source script cannot leave an orphan row: same clear-then-rewrite.
Event order is priority ascending, then script_id ascending: dispatch_order sorts by (priority, script_id).
No Package-independent upload path: only clear_package_range and write_script write game_script; the debug reducer runs source once and never writes.
Left open for the live realm check named in the triage comment. On the production realm the two playerbots scripts are present in game_script on every Shard after today's publish (#365), so the "see it fire" half is what remains.
Verified by Claude (model claude-fable-5-1) via Claude Code.
changed the title [-]Runtime Scripts: reconcile Package scripts on every Shard[/-][+]Confirm on a live realm that a Package's Runtime Script fires for a real event[/+]on Oct 8, 2026
Activity
Mathih13 commentedon Aug 24, 2026
Handoff from the #317 implementation (PR #324): the host ships with no caller in a default build (one narrow
dead_codeallow marks it). The compiler cache has no eviction — lifecycle belongs here. Re-entry through a committed effect is refused, not queued; event bindings are where that policy should actually be decided.Mathih13 commentedon Aug 31, 2026
Batch relevance check, 2026-08-31: implemented and merged; open for live verification.
game_scriptschema withscript_idPK and unique name (module/src/script_binding.rs), reconciliation as the only writer (module/src/package_import/script.rs, clear Package Script Range then rewrite in one transaction), no raw upload reducer, priority-then-script_iddispatch order, per-script failure containment, idempotent re-publication. 64 new tests, including the live-DB suitemodule/tests/package_runtime_scripts.rs.on_loginscript and see it fire, then disable the Package and see the row and effect disappear. PR feat(module): reconcile Package Runtime Scripts on every Shard #358 named this as unrun (no SpacetimeDB credentials in its sandbox).lyracore packages replaystill drives the spell family only, so realm-wide script publication currently has no CLI path (importer/src/package_delta.rs::reapplyskips Script Artifacts by design). This folds into the replay-generalization follow-up issue this session files, together with the claim families items/quests/loot that shipped with the same gap.Mathih13 commentedon Sep 3, 2026
Verification of the code half, 2026-09-02, against main 6f5f0f5.
Live-DB suite
module/tests/package_runtime_scripts.rs(cargo test -p lyracore-module --test package_runtime_scripts -- --ignored --test-threads=1, ownspacetime2.7.1 standalone): 4 passed, 0 failed. One run hit aconnection closed before message completedduring the harness's ownspacetime publish; a re-run passed, so that is the machine, not the module.Unit suites:
script_binding7 passed,package_import::script12 passed,runtime_script32 passed.script_id, name, hash, and binding on every target Shard:Scriptrow inmodule/src/script_binding.rs(script_idprimary key, uniquename), content hash derived at write time.package_import/script.rs); the live test re-applies the same plan and asserts identical rows.script_idascending:dispatch_ordersorts by(priority, script_id).clear_package_rangeandwrite_scriptwritegame_script; the debug reducer runs source once and never writes.lyracore packages replaydoes this for the spell family today; the script family joins it in packages replay: carry the script family to every Shard #393.Left open for the live realm check named in the triage comment. On the production realm the two playerbots scripts are present in
game_scripton every Shard after today's publish (#365), so the "see it fire" half is what remains.Verified by Claude (model claude-fable-5-1) via Claude Code.
[-]Runtime Scripts: reconcile Package scripts on every Shard[/-][+]Confirm on a live realm that a Package's Runtime Script fires for a real event[/+]