fix(rust): lowercase the reward option-source ids, and test the grammar
The first boot against real core refused the whole module at register: `rust.options.runZones` fails core's EVENT_ID grammar, which is lowercase dotted segments only. The fake api validates none of it, so 310 green tests said nothing. The four fixed-choice sources and the chat-server source are renamed, and entry.test now holds every action, budget, lease and option-source id against a copy of the grammar. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
This commit is contained in:
@@ -203,6 +203,24 @@ test('the event verbs are registered, and every budget has a verb that spends it
|
||||
}
|
||||
})
|
||||
|
||||
test('every event id is one the core grammar accepts (phase 13b)', () => {
|
||||
const { api } = register()
|
||||
|
||||
// Core's EVENT_ID (modules/registries.js), copied rather than imported: this
|
||||
// module cannot reach core's tree. The fake api validates none of it, and
|
||||
// phase 13b's first boot against real core refused the WHOLE module over one
|
||||
// camelCase source id (`rust.options.runZones`). Lowercase dotted segments only.
|
||||
const EVENT_ID = /^[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)+$/
|
||||
const ids = [
|
||||
...api.record.eventActions.map((a) => a.id),
|
||||
...api.record.eventBudgets.map((b) => b.id),
|
||||
...api.record.eventOptionSources.map((s) => s.id),
|
||||
...api.record.eventLeases.map((l) => l.id),
|
||||
]
|
||||
for (const a of api.record.eventActions) for (const p of a.params) if (p.source) ids.push(p.source)
|
||||
for (const id of ids) assert.match(id, EVENT_ID, id)
|
||||
})
|
||||
|
||||
test('the leases and their option sources are registered, every source a lease reads (phase 12)', () => {
|
||||
const { api } = register()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user