personal memory agent
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

style(pipeline-health): apply ruff format to new files

Formats the four new files introduced in this branch so `ruff format
--check` is clean for them. Unrelated pre-existing format drift on main
(56 other files) is left as-is.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

+32 -12
+6 -2
apps/health/call.py
··· 18 18 19 19 @app.command("pipeline") 20 20 def pipeline( 21 - day: Optional[str] = typer.Option(None, "--day", help="Day to summarize (YYYYMMDD)."), 22 - yesterday: bool = typer.Option(False, "--yesterday", help="Summarize yesterday's pipeline."), 21 + day: Optional[str] = typer.Option( 22 + None, "--day", help="Day to summarize (YYYYMMDD)." 23 + ), 24 + yesterday: bool = typer.Option( 25 + False, "--yesterday", help="Summarize yesterday's pipeline." 26 + ), 23 27 ) -> None: 24 28 """Summarize dream pipeline health for one day.""" 25 29 if day is not None and yesterday:
+3 -1
apps/health/tests/test_call.py
··· 65 65 json.dumps({"event": "run.start", "mode": "segment"}), 66 66 json.dumps({"event": "agent.dispatch", "mode": "segment"}), 67 67 json.dumps({"event": "agent.complete", "mode": "segment"}), 68 - json.dumps({"event": "run.complete", "mode": "segment", "duration_ms": 42}), 68 + json.dumps( 69 + {"event": "run.complete", "mode": "segment", "duration_ms": 42} 70 + ), 69 71 ] 70 72 ) 71 73 + "\n",
+12 -2
tests/test_pipeline_health.py
··· 47 47 "persisted": 0, 48 48 "agents_fired": False, 49 49 } 50 - assert all(run == {"count": 0, "duration_ms_total": 0} for run in summary["runs"].values()) 50 + assert all( 51 + run == {"count": 0, "duration_ms_total": 0} for run in summary["runs"].values() 52 + ) 51 53 52 54 53 55 def test_missing_health_dir(pipeline_journal): ··· 258 260 @pytest.mark.parametrize( 259 261 ("summary", "expected"), 260 262 [ 261 - ({"status": "healthy", "anomalies": [], "agents": {"failed": 0}, "day": "20260101"}, None), 263 + ( 264 + { 265 + "status": "healthy", 266 + "anomalies": [], 267 + "agents": {"failed": 0}, 268 + "day": "20260101", 269 + }, 270 + None, 271 + ), 262 272 ( 263 273 { 264 274 "status": "stale",
+11 -7
think/pipeline_health.py
··· 27 27 "generated_at": now_ms(), 28 28 "status": "healthy", 29 29 "anomalies": [], 30 - "runs": { 31 - mode: {"count": 0, "duration_ms_total": 0} 32 - for mode in _MODES 33 - }, 30 + "runs": {mode: {"count": 0, "duration_ms_total": 0} for mode in _MODES}, 34 31 "agents": { 35 32 "dispatched": 0, 36 33 "completed": 0, ··· 75 72 continue 76 73 77 74 if not isinstance(rec, dict) or "event" not in rec: 78 - logger.debug("pipeline_health: skipping invalid record in %s", path) 75 + logger.debug( 76 + "pipeline_health: skipping invalid record in %s", path 77 + ) 79 78 continue 80 79 81 80 event = rec["event"] ··· 108 107 except (TypeError, ValueError): 109 108 duration_ms = 0 110 109 summary["runs"][mode]["duration_ms_total"] += duration_ms 111 - elif event == "run.start" and (rec.get("mode") or mode) == "activity": 110 + elif ( 111 + event == "run.start" and (rec.get("mode") or mode) == "activity" 112 + ): 112 113 summary["activities"]["agents_fired"] = True 113 114 except Exception: 114 115 logger.warning( ··· 121 122 for failure in summary["agents"]["failed_list"]: 122 123 summary["anomalies"].append({"kind": "agent_failure", **failure}) 123 124 124 - if summary["activities"]["detected"] > 0 and summary["runs"]["activity"]["count"] == 0: 125 + if ( 126 + summary["activities"]["detected"] > 0 127 + and summary["runs"]["activity"]["count"] == 0 128 + ): 125 129 summary["anomalies"].append({"kind": "activity_agents_missing"}) 126 130 127 131 current = _now()