(features: RoutingFeatures | None)
| 54 | |
| 55 | |
| 56 | def serialize_routing_features(features: RoutingFeatures | None) -> dict[str, object] | None: |
| 57 | if features is None: |
| 58 | return None |
| 59 | |
| 60 | payload = asdict(features) |
| 61 | payload["tool_names"] = list(features.tool_names) |
| 62 | payload["tier_floor"] = features.tier_floor.value if features.tier_floor else None |
| 63 | payload["tier_cap"] = features.tier_cap.value if features.tier_cap else None |
| 64 | return payload |
| 65 | |
| 66 | |
| 67 | def feature_slice_tags(features: RoutingFeatures | None) -> tuple[str, ...]: |