Skip to content

fix(hub): stop "Needs attention" items from perpetually reappearing#2

Merged
deve1993 merged 1 commit into
mainfrom
fix/attention-perpetual-reappearance
Jun 9, 2026
Merged

fix(hub): stop "Needs attention" items from perpetually reappearing#2
deve1993 merged 1 commit into
mainfrom
fix/attention-perpetual-reappearance

Conversation

@deve1993

@deve1993 deve1993 commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Root cause: the dashboard surfaced decay-driven states as actionable, but the actions never reset the underlying counters (sessions_since_validation / confidence), so acting on them was futile and everything came back.

Critical (stop the reappearance):

  • review approve now resets sessions_since_validation + last_validated, so an approved memory no longer bounces back to pending-review on the next decay tick
  • migration 034: partial unique indexes dedup auto-generated skill_proposals and design_system_scans (INSERT OR IGNORE never fired before due to fresh-random ids); session_end / addDesignSystemScan made idempotent
  • "Decaying" redefined as confidence<4 AND sessions_since_validation>=5 (real decay, not memories born below threshold); excludes the M-system* row

Data integrity:

  • skills upsert (INSERT OR REPLACE) now COALESCEs confidence/usage_count/ useful_count/sessions_since_validation/last_validated and status from the existing row, so re-import / dashboard edit / proposal-apply no longer wipe autolearning state or resurrect deprecated / auto-approve pending skills

UX:

  • non-destructive "Reinforce" action (confidence +1, reset staleness) in the memory detail view (previously only Deprecate/Delete)
  • Hub "Needs attention" band now live-refreshes every 30s (was frozen after the first render and diverged from the System Health rows)
  • review badge uses authoritative totals, not array lengths capped at 100

Tests: +9 regression tests (attention-reappearance-fix), updated attention-counts for the new decay predicate. Full suite green (codegraph 294, storage 14).

One-time prod remediation: scripts/remediate-attention-backlog.sh (auto-approve in-place, with automatic backup) to drain the historical 308/30 backlog. Run AFTER deploying so migration 034 + the new logic are live.

Root cause: the dashboard surfaced decay-driven states as actionable, but the
actions never reset the underlying counters (sessions_since_validation /
confidence), so acting on them was futile and everything came back.

Critical (stop the reappearance):
- review approve now resets sessions_since_validation + last_validated, so an
  approved memory no longer bounces back to pending-review on the next decay tick
- migration 034: partial unique indexes dedup auto-generated skill_proposals and
  design_system_scans (INSERT OR IGNORE never fired before due to fresh-random
  ids); session_end / addDesignSystemScan made idempotent
- "Decaying" redefined as confidence<4 AND sessions_since_validation>=5 (real
  decay, not memories born below threshold); excludes the M-_system_* row

Data integrity:
- skills upsert (INSERT OR REPLACE) now COALESCEs confidence/usage_count/
  useful_count/sessions_since_validation/last_validated and status from the
  existing row, so re-import / dashboard edit / proposal-apply no longer wipe
  autolearning state or resurrect deprecated / auto-approve pending skills

UX:
- non-destructive "Reinforce" action (confidence +1, reset staleness) in the
  memory detail view (previously only Deprecate/Delete)
- Hub "Needs attention" band now live-refreshes every 30s (was frozen after the
  first render and diverged from the System Health rows)
- review badge uses authoritative totals, not array lengths capped at 100

Tests: +9 regression tests (attention-reappearance-fix), updated attention-counts
for the new decay predicate. Full suite green (codegraph 294, storage 14).

One-time prod remediation: scripts/remediate-attention-backlog.sh (auto-approve
in-place, with automatic backup) to drain the historical 308/30 backlog. Run
AFTER deploying so migration 034 + the new logic are live.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@deve1993 deve1993 merged commit 68762d4 into main Jun 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant