feat(events): a trigger can start a run (Rust §14.3 stage 9, D370) #216
Reference in New Issue
Block a user
No description provided.
Delete Branch "feat/event-trigger-starts"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Core work from Rust PLAN_REDESIGNS §14.3.12 (D370), stage 9 of §14.3 and the last build stage. A definition's published version may now carry
starts, meaning a trigger, a condition and a cooldown. A firing that matches creates a run of it right away. Examples: "when a champion's boss appears, start Champion's Call", or "when Bradley is destroyed on main, start Launch Site Lockdown".starts: [{ on, where, cooldown }]. It is checked by the phase gate's own validator, so it uses the same grammar and the same dormant rule (a dormant start refuses publish). The cooldown can be0mto7dand defaults to30m. A definition can have at most 10 starts. Core's ownevent.*triggers are refused.events/starts.js: the emit path's third subscriber, next toengine.dispatchand the gate observer. It is never awaited and never rejects.UPDATEon the newevent_trigger_startstable.scheduled_foris the firing's time, so the occurrence key turns one firing reported twice into one run.event_runs.origin: stores the trigger, its label, when it fired, its subject, the condition it matched and its declared variables. It is also written on therun.createdaudit line.Docs: RunicGateway/docs PR for EVENTS.md §D/§E/API, BACKEND_DESIGN.md and PLAN_REDESIGNS §14.3.21 (branch
docs/event-trigger-starts).Tests
test/eventStarts.test.js: 21 new tests, all passing.test/eventRunnerSql.test.js: 7 new tests run against a real MariaDB (75/75 pass). They cover the JSON lookup, one winner out of five concurrent claims, the cooldown boundary, a going run blocking the claim, stale claims andoriginround-tripping.test/eventStarts.test.js: 8 new tests.routeManifest.test.js, which fail the same way on an untouchedmainon this machine because they read the locally installed modules. Client 430/430, build OK,check:modulesandcheck:hostsOK.uomodule and the dev MariaDB, with a definition starting onuo.champ.boss_upwhere spawnName is Abyss and the cooldown is 1m:AI disclosure
🤖 Generated with Claude Code
https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY