[kimi-task] [feat] Add matrix config loader utility #680

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

Epic: Matrix Unification

Task

Create a config loader module that the Matrix frontend will use to fetch its configuration
from the Dashboard API instead of using hardcoded values.

Files

  • src/infrastructure/matrix_config.py — NEW: MatrixConfig dataclass + load_from_yaml()
  • config/matrix.yaml — NEW: default Matrix world configuration
  • tests/unit/test_matrix_config.py — NEW: test loading and defaults

Acceptance Criteria

  • MatrixConfig dataclass with sections: lighting, environment, features, agents
  • load_from_yaml(path) loads config/matrix.yaml
  • Missing keys fall back to sensible defaults (not crash)
  • Default lighting: warm amber ambient + cool blue starfield (Workshop + Matrix blend)
  • Default features: all enabled
  • tox -e unit passes
  • tox -e lint passes

Context

This is the backend side of config. The /api/matrix/config endpoint will serve this.
The Matrix frontend js/ files will fetch this on boot instead of hardcoding values.
Lighting defaults should blend Workshop warmth (amber 0xFFAA55) with Matrix cool (blue 0x4466FF).

## Epic: Matrix Unification ## Task Create a config loader module that the Matrix frontend will use to fetch its configuration from the Dashboard API instead of using hardcoded values. ## Files - src/infrastructure/matrix_config.py — NEW: MatrixConfig dataclass + load_from_yaml() - config/matrix.yaml — NEW: default Matrix world configuration - tests/unit/test_matrix_config.py — NEW: test loading and defaults ## Acceptance Criteria - [ ] MatrixConfig dataclass with sections: lighting, environment, features, agents - [ ] load_from_yaml(path) loads config/matrix.yaml - [ ] Missing keys fall back to sensible defaults (not crash) - [ ] Default lighting: warm amber ambient + cool blue starfield (Workshop + Matrix blend) - [ ] Default features: all enabled - [ ] tox -e unit passes - [ ] tox -e lint passes ## Context This is the backend side of config. The /api/matrix/config endpoint will serve this. The Matrix frontend js/ files will fetch this on boot instead of hardcoding values. Lighting defaults should blend Workshop warmth (amber 0xFFAA55) with Matrix cool (blue 0x4466FF).
kimi self-assigned this 2026-03-21 03:12:12 +00:00
Author
Collaborator

PR created: #742

Implementation Summary

Created the matrix config loader utility as specified:

Files Added/Modified

  • src/infrastructure/matrix_config.py (258 lines)

    • MatrixConfig dataclass with nested sections: lighting, environment, features, agents
    • load_from_yaml(path) - loads config with sensible defaults for missing keys
    • to_dict() - serialization for API responses
  • config/matrix.yaml - Updated with Workshop+Matrix blend:

    • Ambient: warm amber #FFAA55 (Workshop warmth)
    • Point lights: warm center + cool blue/purple accents (Matrix feel)
    • Starfield enabled by default
    • All features enabled
  • tests/unit/test_matrix_config.py (289 lines)

    • Comprehensive tests for all dataclasses
    • Tests for loading, defaults, error handling
    • 2564 tests passing

API Usage

from infrastructure.matrix_config import load_from_yaml

config = load_from_yaml("config/matrix.yaml")
print(config.lighting.ambient_color)  # "#FFAA55"
print(config.features.chat_enabled)   # True

Ready for review.

✅ **PR created: #742** ## Implementation Summary Created the matrix config loader utility as specified: ### Files Added/Modified - `src/infrastructure/matrix_config.py` (258 lines) - `MatrixConfig` dataclass with nested sections: lighting, environment, features, agents - `load_from_yaml(path)` - loads config with sensible defaults for missing keys - `to_dict()` - serialization for API responses - `config/matrix.yaml` - Updated with Workshop+Matrix blend: - Ambient: warm amber `#FFAA55` (Workshop warmth) - Point lights: warm center + cool blue/purple accents (Matrix feel) - Starfield enabled by default - All features enabled - `tests/unit/test_matrix_config.py` (289 lines) - Comprehensive tests for all dataclasses - Tests for loading, defaults, error handling - 2564 tests passing ### API Usage ```python from infrastructure.matrix_config import load_from_yaml config = load_from_yaml("config/matrix.yaml") print(config.lighting.ambient_color) # "#FFAA55" print(config.features.chat_enabled) # True ``` Ready for review.
kimi closed this issue 2026-03-21 15:05:07 +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#680