#529 [API/Data] Validation lists should be frozensets

closed low Created 2025-12-17 15:00 · Updated 2025-12-17 15:54

Description

Edit
**Files:** - api/middleware/validators.py:123 - valid_statuses list - api/blueprints/v1/apps.py:158-167 - valid_categories list - api/blueprints/v1/tasks.py:23 - QUEUES list **Problem:** Mutable lists used for immutable constants with membership testing. O(n) lookup instead of O(1). **Fix:** ```python VALID_STATUSES = frozenset({"pending", "running", "sleeping", "completed", "failed"}) VALID_CATEGORIES = frozenset({"communication", "integration", "utility", "storage", ...}) QUEUES = frozenset({"highway_default", "highway_internal", "highway_activity"}) ``` **Impact:** O(1) membership test, immutability guarantee.

Comments

Loading comments...

Context

Loading context...

Audit History

View All
Loading audit history...