Avatar Development Fixtures
Development fixtures provide repeatable local inputs for regression testing and rendering validation without an active Runtime session. Setting VITE_AVATAR_DRIVER=mock instructs the driver factory to instantiate MockDriver. By default, the factory initializes SdkDriver, which requires valid SDK bootstrap inputs.
Fixtures validate scenario parsing, event scheduling, and local state mapping. Rendering a development avatar model additionally requires a valid model manifest in the fixture configuration; event JSON alone does not guarantee visible canvas output. Fixture-driven previews remain marked as fixture_not_verified and cannot be used to close formal product acceptance.
Current Driver Interface
The renderer interacts with the driver through AgentDataDriver, which exposes:
- Lifecycle and state:
start,stop,getBundle, andonStatusChange - Event and bundle handling:
onEvent,onBundleChange, andemit - Optional capabilities:
emitCancelable
The kind and status properties are read-only. Bundle updates are reported exclusively through onBundleChange (there is no onAgentDataChange callback).
When constructing drivers via the factory:
MockDriverrequiresscenarioJsonand accepts an optionalscenarioSource.SdkDriverrequires explicitSdkDriverOptionsand cannot be instantiated with a zero-argument constructor.
Scenario Format
| Field | Requirement |
|---|---|
scenario_id | Non-empty string; must match the fixture filename when loaded from disk |
version | String "1" |
description | Descriptive scenario summary string |
duration_ms | Optional finite positive number or null; a value is required when loop is true |
loop | Required boolean |
agent_bootstrap | Initial fixture context: world ID, user ID, locale, posture, status text, and execution state |
events | Required array of scenario events; use [] for a static preview |
triggers | Optional interactive trigger definitions |
Fixture scenarios do not include a top-level bundle or meta wrapper. Events support two scheduling models:
- Timed events: define
kind: "time",at_ms,type, anddetail. - Sequenced events: define
kind: "after",after_event_id,delay_ms,type, anddetail. The event referenced byafter_event_idmust exist in the scenario.
Simulated user or agent activity in fixtures emits avatar.fixture.presentation.activity_requested with source="mock". Synthetic events generated by fixtures are strictly local and are not Runtime-authorized events.
Static Input Example
Save the following scenario as static-preview.mock.json:
{
"scenario_id": "static-preview",
"version": "1",
"description": "Static development preview",
"duration_ms": null,
"loop": false,
"agent_bootstrap": {
"active_world_id": "fixture-world",
"active_user_id": "fixture-user",
"locale": "en-US",
"initial_posture": {
"posture_class": "baseline_observer",
"action_family": "observe",
"interrupt_mode": "welcome",
"transition_reason": "scenario_start",
"truth_basis_ids": []
},
"initial_status_text": "Development preview",
"initial_execution_state": "IDLE"
},
"events": []
}Identity and environment fields configured in agent_bootstrap (such as active_world_id and active_user_id) exist solely within the local test fixture. They do not provision a live account, create an App session, or establish conversation continuity.
Validate custom scenario files against the renderer's loadScenarioFromJson and parseScenario loaders; default.mock.json provides an end-to-end reference implementation. Final 3D model presentation and live runtime paths must still be verified through dedicated integration checks.
Related Documentation
Source Basis
.nimi/spec/avatar/embodiment-surface.authority.yamlapps/avatar/src/shell/renderer/driver/types.tsapps/avatar/src/shell/renderer/driver/factory.tsapps/avatar/src/shell/renderer/mock/scenario-types.tsapps/avatar/src/shell/renderer/mock/scenario-loader.tsapps/avatar/src/shell/renderer/mock/scenarios/default.mock.jsonapps/avatar/src/shell/renderer/app-shell/app-bootstrap.ts