From 2dab243b28af60e17b78e5de0a6e9ede824cd611 Mon Sep 17 00:00:00 2001 From: Drewry Pope Date: Sun, 22 Nov 2026 20:15:07 -0600 Subject: [PATCH] fix(aggregator): attach structured activity source links --- pm-stack/aggregator/src/activity.ts | 4 ++++ pm-stack/aggregator/test/activity-github-7084.test.ts | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/pm-stack/aggregator/src/activity.ts b/pm-stack/aggregator/src/activity.ts index 98ed06978f..ded1de1a18 100644 --- a/pm-stack/aggregator/src/activity.ts +++ b/pm-stack/aggregator/src/activity.ts @@ -667,6 +667,10 @@ export class IngestionStore { kind: d.kind, ref: d.ref, summary: capUnits(d.link ? `${d.summary} — ${d.link}` : d.summary, 500), + source: { + identity: `pm-stack/aggregator/activity/${d.source}`, + ...(d.link ? { link: d.link } : {}), + }, }); } catch (err) { failed++; diff --git a/pm-stack/aggregator/test/activity-github-7084.test.ts b/pm-stack/aggregator/test/activity-github-7084.test.ts index d9a3a7ae29..dfe2156099 100644 --- a/pm-stack/aggregator/test/activity-github-7084.test.ts +++ b/pm-stack/aggregator/test/activity-github-7084.test.ts @@ -219,9 +219,12 @@ describe("GitHub hot-list consumer (#7084)", () => { "activity:github:delivery:3", ]); expect(stream.every((event) => event.kind === "github-event")).toBe(true); - expect(stream.find((event) => event.id === "activity:github:delivery:1")?.summary).toContain( - "https://github.com/developing-today/code/issues/1", - ); + const first = stream.find((event) => event.id === "activity:github:delivery:1"); + expect(first?.summary).toContain("https://github.com/developing-today/code/issues/1"); + expect(first?.source).toEqual({ + identity: "pm-stack/aggregator/activity/github", + link: "https://github.com/developing-today/code/issues/1", + }); }); test("an oversized push ref falls back to the repo ref instead of stalling the sweep", async () => {