1## ADDED Requirements23### Requirement: The app SHALL load local CommonJS mods through a validated manifest4The mod loader SHALL load local CommonJS source and read its `module.exports` object containing a required `manifest` (`id`, `name`, and semantic `version`), one or more `levels`, and optional `vocabulary` and `palette` records. The host SHALL validate the complete export before registering any content and SHALL keep built-in content available when a mod fails validation.56#### Scenario: A valid mod registers a level7- **WHEN** a local module exports a valid manifest, level definition, vocabulary, and palette8- **THEN** the loader registers its level and uses its palette for noun presentation under that mod id910#### Scenario: A malformed mod is rejected11- **WHEN** a module has no id, duplicate identifiers, invalid coordinates, or unsupported vocabulary values12- **THEN** the loader rejects it with a diagnostic and does not partially register its content1314### Requirement: Mods SHALL use the host engine contract15Mods SHALL define vocabulary, palette, and level data through the exported object. Mods SHALL NOT directly mutate the active rule table, DOM, renderer scheduler, or persisted engine state; the host SHALL pass validated level data to the engine.1617#### Scenario: A mod adds a noun and emoji18- **WHEN** a manifest declares noun `KEKE` and its emoji representation19- **THEN** levels from that mod can place `KEKE` objects and the presentation uses the declared mapping2021#### Scenario: A mod cannot bypass the engine state contract22- **WHEN** a mod supplies malformed level state or attempts to change state through data outside the documented manifest fields23- **THEN** the host registers only validated manifest, vocabulary, palette, and level data and keeps engine state under host control2425### Requirement: Mod loading SHALL be deterministic for the local MVP26The loader SHALL run local mods with the host's documented CommonJS compatibility layer, allow only the host's supported helper import, and avoid URL or package resolution. Module execution and validation errors SHALL be isolated to the affected mod and shown in diagnostics.2728#### Scenario: A mod error does not break built-in play29- **WHEN** a local module throws while loading or requests an unsupported import30- **THEN** the app reports the mod error and keeps built-in levels playable