|
| 1 | +# Engine Object Model Baseline |
| 2 | + |
| 3 | +PR: PR_26152_164-engine-object-model-baseline |
| 4 | +Date: 2026-06-02 |
| 5 | + |
| 6 | +## Scope |
| 7 | + |
| 8 | +- Defined the authoritative engine object model. |
| 9 | +- Mapped object types to engine ownership. |
| 10 | +- Defined Static, Dynamic, Killable, Collectible, Trigger, Projectile, Zone, and UI behavior ownership. |
| 11 | +- Identified reusable `src` capability requirements. |
| 12 | +- Added no runtime implementation. |
| 13 | + |
| 14 | +## Authoritative Object Model |
| 15 | + |
| 16 | +Engine objects are validated runtime records created from manifest-owned object declarations. The manifest owns authored object identity, object type, geometry references, rule references, and default configuration. Engine runtime owns entity creation, active component state, per-frame mutation, collision results, timers, and rendered output. |
| 17 | + |
| 18 | +ProjectWorkspace remains coordination-only. It may identify the active project, manifest, tool, and toolState references, but it must not persist object records or runtime object state. |
| 19 | + |
| 20 | +## Object Type Ownership |
| 21 | + |
| 22 | +| Object Type | Manifest Owns | Engine Runtime Owns | Reusable `src` Capability | |
| 23 | +| --- | --- | --- | --- | |
| 24 | +| Static | Identity, geometry reference, render role, collision layer, blocking flag. | Entity creation, static collision participation, render participation. | `src/engine/ecs/World.js`, `src/engine/components/Components.js`, collision/render systems. | |
| 25 | +| Dynamic | Identity, geometry reference, movement rule refs, collision refs. | Position, previous position, velocity, bounds response, input-driven movement. | `MovementSystem.js`, `InputControlSystem.js`, `BoundsSystem.js`. | |
| 26 | +| Killable | Identity, max health, damage rules, death/despawn rule refs. | Current health, invulnerability, death flag, death events. | `src/engine/combat/Combat.js`, lifecycle/despawn adapters. | |
| 27 | +| Collectible | Identity, collection conditions, scoring/despawn refs. | Collection detection, collected state, removal, event dispatch. | `CollectSystem.js`, collision helpers, scoring rule adapter. | |
| 28 | +| Trigger | Identity, trigger condition, event name, cooldown rule refs. | Runtime enter/exit/contact evaluation, emitted event records, cooldown state. | Event bus, collision helpers, cooldown registry. | |
| 29 | +| Projectile | Identity, spawn refs, movement, damage, lifetime, collision refs. | Spawned instance state, movement, collision, lifetime, despawn. | `ProjectileSystem.js`, `LifecycleSystem.js`, collision/combat helpers. | |
| 30 | +| Zone | Identity, bounds/geometry, zone conditions, rule refs. | Runtime overlap tracking, enter/exit/inside events. | Collision helpers, event bus, zone adapter. | |
| 31 | +| UI | Identity, binding source, layout slot, render role. | Runtime state binding, draw/update timing, user-visible status. | Rendering/UI runtime adapters. | |
| 32 | + |
| 33 | +## Required Model Fields |
| 34 | + |
| 35 | +Future manifest object records should require: |
| 36 | + |
| 37 | +- `objectId` |
| 38 | +- `objectType` |
| 39 | +- `geometryRef` or explicit `bounds` for zone/UI records |
| 40 | +- `rules` array |
| 41 | +- `components` or component hints for runtime creation |
| 42 | +- `visibility` or render participation where applicable |
| 43 | + |
| 44 | +Runtime-created records should add only transient fields: |
| 45 | + |
| 46 | +- `entityId` |
| 47 | +- active component instances |
| 48 | +- runtime timers |
| 49 | +- collision/contact state |
| 50 | +- current health/score/collected/despawn state |
| 51 | + |
| 52 | +## Reusable `src` Capability Requirements |
| 53 | + |
| 54 | +| Requirement | Current Capability | Gap | |
| 55 | +| --- | --- | --- | |
| 56 | +| Entity/component storage | `src/engine/ecs/World.js` | Needs manifest object factory wrapper. | |
| 57 | +| Component primitives | `src/engine/components/Components.js` | Needs object-type component mapping and additional health/rule/cooldown components. | |
| 58 | +| Movement | `src/engine/systems/MovementSystem.js` | Needs manifest-driven movement adapter. | |
| 59 | +| Collision | `CollisionSystem.js` and collision helpers | Needs layer/mask/response registry. | |
| 60 | +| Projectile lifecycle | `ProjectileSystem.js` and `LifecycleSystem.js` | Needs explicit manifest-derived defaults, no hidden fallback. | |
| 61 | +| Health/damage | `src/engine/combat/Combat.js` | Needs object model adapter and manifest damage profile mapping. | |
| 62 | +| Collection | `CollectSystem.js` | Needs manifest scoring/despawn integration. | |
| 63 | +| Zones/triggers | Event/collision primitives | Needs shared zone/trigger runtime adapter. | |
| 64 | +| UI object binding | Rendering/UI primitives | Needs manifest UI binding contract before implementation. | |
| 65 | + |
| 66 | +## Validation |
| 67 | + |
| 68 | +Command: |
| 69 | + |
| 70 | +```powershell |
| 71 | +git diff --check |
| 72 | +``` |
| 73 | + |
| 74 | +Result: PASS. |
| 75 | + |
| 76 | +## Lanes Executed |
| 77 | + |
| 78 | +- engine - documentation/static object model baseline. |
| 79 | +- contract - documentation/static manifest and ProjectWorkspace ownership review. |
| 80 | + |
| 81 | +## Lanes Skipped |
| 82 | + |
| 83 | +- runtime - no runtime behavior changed. |
| 84 | +- integration - no ProjectWorkspace handoff implementation changed. |
| 85 | +- samples - permanently out of scope. |
| 86 | +- recovery/UAT - no recovery behavior changed. |
| 87 | +- Playwright - not impacted. |
| 88 | + |
| 89 | +## Samples Decision |
| 90 | + |
| 91 | +SKIP. Samples are permanently out of scope. |
| 92 | + |
| 93 | +## Playwright |
| 94 | + |
| 95 | +Playwright impacted: No. This PR is docs/report-only. |
| 96 | + |
| 97 | +## Blocker Scope |
| 98 | + |
| 99 | +No blocker for the baseline report. Runtime implementation is blocked until object model schema and validation are approved. |
0 commit comments