diff --git a/pm-stack/aggregator/src/render.ts b/pm-stack/aggregator/src/render.ts index 3f744526f1..c071288741 100644 --- a/pm-stack/aggregator/src/render.ts +++ b/pm-stack/aggregator/src/render.ts @@ -3590,12 +3590,19 @@ function reconciledInProgress(data: OverviewData): OverviewInProgressItem[] { for (const task of goal.linedUp) { if (task.status !== "in-progress") continue; if (task.ref) { - signal(task.ref, "active-session", task.title); + // #6205: a lined-up ref is feed data, not necessarily a GitHub + // ref (goal ids, bare numbers). Signaling an invalid ref makes + // ensure() fall back to refUrl(), whose parseRef throws and + // kills the whole overview — skip refs the shared rule rejects. + if (isValidRef(task.ref)) signal(task.ref, "active-session", task.title); continue; } for (const ref of refsInText(task.title)) signal(ref, "active-session", task.title); for (const match of task.title.matchAll(/([\w.-]+\/[\w.-]+)#(\d+)/g)) { - signal(`${match[1]}#${match[2]}`, "active-session", task.title); + const ref = `${match[1]}#${match[2]}`; + // #6205: same guard for title-scraped refs — \d+ admits + // numbers parseRef rejects as unsafe integers. + if (isValidRef(ref)) signal(ref, "active-session", task.title); } } } diff --git a/pm-stack/aggregator/test/overview.test.ts b/pm-stack/aggregator/test/overview.test.ts index 31eede6746..62f032f5f4 100644 --- a/pm-stack/aggregator/test/overview.test.ts +++ b/pm-stack/aggregator/test/overview.test.ts @@ -404,3 +404,98 @@ describe("overview Codex fixes (PR 2424 review)", () => { expect(summary.inProgress.map((i) => i.title)).toEqual(["One", "Running thing"]); }); }); + +describe("overview reconciledInProgress ref guards (#6205)", () => { + const withLinedUp = (linedUp: unknown[]): OverviewData => ({ + ...data, + pool: [], + board: [], + orchestration: { + version: 1, + generatedAt: "2026-10-29T00:00:00Z", + runId: "orch-6205", + provenance: { sources: [] }, + tiers: { needsDrew: [], needsOrchestrator: [] }, + dependencies: [], + goals: [ + { + goalId: null, + goal: "test goal", + momentum: "moving", + summary: "test", + linedUp, + progressedSinceLastRun: [], + stalled: [], + gaps: [], + }, + ], + actions: [], + } as unknown as OrchestrationSection, + }); + const task = (over: Record) => ({ + title: "Lined-up work", + status: "in-progress", + horizon: "today", + horizonWhy: "test", + ...over, + }); + + test("a goal-id task.ref does not throw and yields no row for it", () => { + const d = withLinedUp([task({ ref: "goal_a243772844c3" as RefKey })]); + expect(() => deriveOverview(d)).not.toThrow(); + const summary = deriveOverview(d); + expect(summary.inProgress.map((i) => i.ref)).not.toContain( + "goal_a243772844c3", + ); + expect(summary.inProgress).toEqual([]); + }); + + test("a bare numeric task.ref does not throw and yields no row for it", () => { + const d = withLinedUp([task({ ref: "812" as RefKey })]); + expect(() => deriveOverview(d)).not.toThrow(); + expect(deriveOverview(d).inProgress).toEqual([]); + }); + + test("an unsafe-integer title mention does not throw", () => { + const d = withLinedUp([ + task({ title: "Fix developing-today/code#99999999999999999999 now" }), + ]); + expect(() => deriveOverview(d)).not.toThrow(); + expect(deriveOverview(d).inProgress).toEqual([]); + }); + + test("a valid task.ref still yields an in-progress row with its GitHub URL", () => { + const d = withLinedUp([ + task({ ref: "developing-today/code#123" as RefKey }), + ]); + const summary = deriveOverview(d); + const row = summary.inProgress.find( + (i) => i.ref === "developing-today/code#123", + ); + expect(row?.signals).toEqual(["active-session"]); + expect(row?.url).toBe("https://github.com/developing-today/code/issues/123"); + }); + + test("a valid plain title mention still yields an in-progress row", () => { + const d = withLinedUp([ + task({ title: "Work on developing-today/code#124 today" }), + ]); + const summary = deriveOverview(d); + const row = summary.inProgress.find( + (i) => i.ref === "developing-today/code#124", + ); + expect(row?.signals).toEqual(["active-session"]); + expect(row?.url).toBe("https://github.com/developing-today/code/issues/124"); + }); + + test("invalid refs do not suppress valid rows in the same goal", () => { + const d = withLinedUp([ + task({ ref: "goal_a243772844c3" as RefKey, title: "Goal work" }), + task({ ref: "developing-today/code#125" as RefKey, title: "Real work" }), + ]); + const summary = deriveOverview(d); + expect(summary.inProgress.map((i) => i.ref)).toEqual([ + "developing-today/code#125", + ]); + }); +});