Helper to dump full database state to debug log. Args: feature_dicts: Pre-fetched list of feature dicts. label: Optional label for the dump entry.
(feature_dicts: list[dict], label: str = "")
| 88 | |
| 89 | |
| 90 | def _dump_database_state(feature_dicts: list[dict], label: str = ""): |
| 91 | """Helper to dump full database state to debug log. |
| 92 | |
| 93 | Args: |
| 94 | feature_dicts: Pre-fetched list of feature dicts. |
| 95 | label: Optional label for the dump entry. |
| 96 | """ |
| 97 | passing = [f for f in feature_dicts if f.get("passes")] |
| 98 | in_progress = [f for f in feature_dicts if f.get("in_progress") and not f.get("passes")] |
| 99 | pending = [f for f in feature_dicts if not f.get("passes") and not f.get("in_progress")] |
| 100 | |
| 101 | debug_log.log("DB_DUMP", f"Full database state {label}", |
| 102 | total_features=len(feature_dicts), |
| 103 | passing_count=len(passing), |
| 104 | passing_ids=[f["id"] for f in passing], |
| 105 | in_progress_count=len(in_progress), |
| 106 | in_progress_ids=[f["id"] for f in in_progress], |
| 107 | pending_count=len(pending), |
| 108 | pending_ids=[f["id"] for f in pending[:10]]) # First 10 pending only |
| 109 | |
| 110 | # ============================================================================= |
| 111 | # Process Limits |