[kimi-task] [feat] Add /api/matrix/config endpoint — serve world config to Matrix #674

Closed
opened 2026-03-21 03:12:07 +00:00 by kimi · 1 comment
Collaborator

Epic: Matrix Unification

Task

Add GET /api/matrix/config endpoint that returns world configuration: lighting presets,
environment settings, and feature flags. This lets the Matrix frontend be config-driven
rather than hardcoded.

Files

  • src/dashboard/routes/world.py — add /api/matrix/config route
  • config/matrix.yaml — NEW: world config (lighting, environment, features)
  • tests/timmy/test_world_api.py — add test

Acceptance Criteria

  • Returns JSON with sections: lighting, environment, features
  • lighting: ambient_color, ambient_intensity, point_lights (array of {color, intensity, position})
  • environment: rain_enabled, starfield_enabled, fog_color, fog_density
  • features: chat_enabled, visitor_avatars, pip_familiar, workshop_portal
  • Reads from config/matrix.yaml, falls back to sensible defaults
  • tox -e unit passes
  • tox -e lint passes

Context

The Matrix frontend has hardcoded lighting and environment. By serving config from the backend,
we can adjust the world without redeploying the frontend. This also enables the Workshop's warm
lighting to coexist with the Matrix's cool ambient (issue #87 in the-matrix repo).

## Epic: Matrix Unification ## Task Add GET /api/matrix/config endpoint that returns world configuration: lighting presets, environment settings, and feature flags. This lets the Matrix frontend be config-driven rather than hardcoded. ## Files - src/dashboard/routes/world.py — add /api/matrix/config route - config/matrix.yaml — NEW: world config (lighting, environment, features) - tests/timmy/test_world_api.py — add test ## Acceptance Criteria - [ ] Returns JSON with sections: lighting, environment, features - [ ] lighting: ambient_color, ambient_intensity, point_lights (array of {color, intensity, position}) - [ ] environment: rain_enabled, starfield_enabled, fog_color, fog_density - [ ] features: chat_enabled, visitor_avatars, pip_familiar, workshop_portal - [ ] Reads from config/matrix.yaml, falls back to sensible defaults - [ ] tox -e unit passes - [ ] tox -e lint passes ## Context The Matrix frontend has hardcoded lighting and environment. By serving config from the backend, we can adjust the world without redeploying the frontend. This also enables the Workshop's warm lighting to coexist with the Matrix's cool ambient (issue #87 in the-matrix repo).
kimi self-assigned this 2026-03-21 03:12:07 +00:00
Author
Collaborator

PR #736 created.

Summary of Changes

Files Added/Modified

  1. config/matrix.yaml (new) - World configuration with:

    • Lighting: ambient color/intensity, 3 point lights
    • Environment: rain/starfield toggles, fog settings
    • Features: chat, avatars, Pip familiar, workshop portal flags
  2. src/dashboard/routes/world.py - Added:

    • GET /api/matrix/config endpoint
    • _DEFAULT_MATRIX_CONFIG fallback defaults
    • _load_matrix_config() function with graceful degradation
  3. tests/dashboard/test_world_api.py - Added 10+ new tests:

    • TestMatrixConfigEndpoint: Tests for endpoint response structure
    • TestMatrixConfigLoading: Tests for config loading, merging, and fallbacks

Acceptance Criteria Met

  • Returns JSON with sections: lighting, environment, features
  • lighting: ambient_color, ambient_intensity, point_lights[]
  • environment: rain_enabled, starfield_enabled, fog_color, fog_density
  • features: chat_enabled, visitor_avatars, pip_familiar, workshop_portal
  • Reads from config/matrix.yaml, falls back to sensible defaults
  • tox -e unit passes (2491 tests)
  • tox -e lint passes
PR #736 created. ## Summary of Changes ### Files Added/Modified 1. **config/matrix.yaml** (new) - World configuration with: - Lighting: ambient color/intensity, 3 point lights - Environment: rain/starfield toggles, fog settings - Features: chat, avatars, Pip familiar, workshop portal flags 2. **src/dashboard/routes/world.py** - Added: - `GET /api/matrix/config` endpoint - `_DEFAULT_MATRIX_CONFIG` fallback defaults - `_load_matrix_config()` function with graceful degradation 3. **tests/dashboard/test_world_api.py** - Added 10+ new tests: - `TestMatrixConfigEndpoint`: Tests for endpoint response structure - `TestMatrixConfigLoading`: Tests for config loading, merging, and fallbacks ### Acceptance Criteria Met - ✅ Returns JSON with sections: lighting, environment, features - ✅ lighting: ambient_color, ambient_intensity, point_lights[] - ✅ environment: rain_enabled, starfield_enabled, fog_color, fog_density - ✅ features: chat_enabled, visitor_avatars, pip_familiar, workshop_portal - ✅ Reads from config/matrix.yaml, falls back to sensible defaults - ✅ tox -e unit passes (2491 tests) - ✅ tox -e lint passes
kimi closed this issue 2026-03-21 14:25:20 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#674