Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pm-stack/aggregator/src/digest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@ export function buildDigest(inputs: DigestInputs): Digest {
.filter(
(p) =>
(p.freshness?.state ?? p.state) === "error" ||
(p.freshness?.state ?? p.state) === "stale",
(p.freshness?.state ?? p.state) === "stale" ||
(p.freshness?.state ?? p.state) === "lapsed",
)
.map((p) => p.provider);
quotaSection = {
Expand Down
23 changes: 23 additions & 0 deletions pm-stack/aggregator/test/digest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,29 @@ describe("buildDigest", () => {
expect(outlook.staleNote).toContain("Down");
});

test("quota outlook marks a lapsed-only provider degraded (#8124)", () => {
const lapsed: QuotaView = {
...quota,
pools: [
{
id: "pool-lapsed",
provider: "Lapsed",
plan: "Plan",
state: "lapsed",
freshness: { measuredAt: "2026-11-02T06:00:00Z", source: "gatherer", state: "lapsed" },
windows: [
{ name: "weekly", unit: "tokens", limit: 1000, used: 100, resetsAt: "2026-11-09T00:00:00Z", percent: 10 },
],
},
],
};
const d = buildDigest(inputs({ quota: lapsed }));
const outlook = section(d, "quota");
expect(outlook.stale).toBe(true);
expect(outlook.staleNote).toContain("Lapsed");
expect(outlook.staleNote).toContain("provider reads degraded");
});

test("chat text states freshness and links every section item", () => {
const text = digestText(buildDigest(inputs()));
expect(text).toContain("PM daily digest — 2026-11-02");
Expand Down
Loading