Create an empty profile payload with the full schema.
(user_id: str)
| 123 | |
| 124 | |
| 125 | def build_empty_profile(user_id: str) -> Dict[str, Any]: |
| 126 | """Create an empty profile payload with the full schema.""" |
| 127 | now = datetime.now().isoformat() |
| 128 | return { |
| 129 | "user_id": user_id, |
| 130 | "version": "0.1", |
| 131 | "created_at": now, |
| 132 | "updated_at": now, |
| 133 | "core_directions": {}, |
| 134 | "methodology_preferences": {}, |
| 135 | "must_read": { |
| 136 | "authors": [], |
| 137 | "institutions": [], |
| 138 | "keywords": [], |
| 139 | }, |
| 140 | "topic_weights": {}, |
| 141 | "author_heat": {}, |
| 142 | "institution_heat": {}, |
| 143 | "interest_vector": [], |
| 144 | "taste_profile": {}, |
| 145 | "reading_history": [], |
| 146 | "behavior_logs": [], |
| 147 | "drift_state": build_default_drift_state(now), |
| 148 | } |
| 149 | |
| 150 | |
| 151 | def ensure_profile_shape(profile: Optional[Dict[str, Any]], user_id: str) -> Dict[str, Any]: |
no test coverage detected