From 9a943e846031d4de36d1647588e7e403edface92 Mon Sep 17 00:00:00 2001 From: m3taversal Date: Thu, 23 Apr 2026 12:20:26 +0100 Subject: [PATCH] feat: expose source_channel on activity feed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds p.source_channel to the SELECT and surfaces it on each event. Migration v22 populated the column with enum values: telegram, agent, maintenance, unknown, github. Timeline UI needs this to show per-event provenance (2340 telegram, 698 agent, 102 maintenance, 11 unknown, 1 github). Nulls fall back to "unknown" — only 0 rows currently null, but the fallback is defensive for future inserts before backfill runs. Co-Authored-By: Claude Opus 4.7 (1M context) --- diagnostics/activity_feed_api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/diagnostics/activity_feed_api.py b/diagnostics/activity_feed_api.py index a21beb6..a33a17c 100644 --- a/diagnostics/activity_feed_api.py +++ b/diagnostics/activity_feed_api.py @@ -83,7 +83,8 @@ def _build_events(): try: rows = conn.execute(""" SELECT p.number, p.branch, p.domain, p.agent, p.submitted_by, - p.merged_at, p.description, p.commit_type, p.cost_usd + p.merged_at, p.description, p.commit_type, p.cost_usd, + p.source_channel FROM prs p WHERE p.status = 'merged' AND p.commit_type = 'knowledge' @@ -139,6 +140,7 @@ def _build_events(): "ci_earned": round(ci_earned, 2), "summary": summary_text, "pr_number": row["number"], + "source_channel": row["source_channel"] or "unknown", }) return events, claim_activity