Personal_AI_Infrastructure icon indicating copy to clipboard operation
Personal_AI_Infrastructure copied to clipboard

fix(pulse): pending-proposal badge never clears — only `auto-applied` counts as resolved

Open xmasyx opened this issue 4 months ago • 1 comments

Summary

The Pulse memory badge counts a proposal as pending unless its status is exactly auto-applied. Every other terminal state — applied (a human accepted it) and dismissed (a human rejected it) — stays counted forever, so the badge never returns to zero once a proposal has been resolved by hand.

Root cause

LIFEOS/PULSE/modules/memory.ts:238:

pendingProposals: proposals.filter((p: any) => p.status !== "auto-applied").length,

The filter enumerates a single terminal state by exclusion. Any status the pipeline can reach that is not that one literal counts as outstanding work, including the two states that mean a human already dealt with it.

Impact

A badge that cannot return to zero stops being read. After the first hand-resolved proposal the number only ever grows, so the signal that should say "something needs you" becomes decoration — and the next genuinely pending proposal arrives invisible inside a count that was already non-zero.

Proposed fix

Enumerate the terminal states positively, and deliberately leave auto-apply-failed out of them — a failed apply is a signal that still wants attention, not a resolution:

// Terminal statuses a proposal can reach: it silently applied, a human accepted it, or a
// human dismissed it. Anything else ("pending", "auto-apply-failed") still wants attention
// and stays counted. "auto-apply-failed" is deliberately NOT resolved — a failed apply is
// a signal, not a resolution.
const RESOLVED_PROPOSAL_STATUSES = new Set(["auto-applied", "applied", "dismissed"]);

// …
pendingProposals: proposals.filter((p: any) => !RESOLVED_PROPOSAL_STATUSES.has(p.status)).length,

Running locally since 2026-07-25; the badge clears as expected and a failed auto-apply still shows.

xmasyx avatar Jul 25 '26 21:07 xmasyx

Fixed, with one correction to the filed fix: the real status union is pending/sent/accepted/rejected/edited/auto-applied, so the terminal set now excludes accepted/rejected/edited as well, while sent (surfaced, awaiting a decision) stays counted. Your instinct to keep auto-apply-failed visible was right and is preserved. Credited in source.

danielmiessler avatar Jul 29 '26 12:07 danielmiessler