From 437bf4d37aec82f3700df5beeeea93324cf9afb6 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Fri, 3 Jul 2026 22:00:49 -0400 Subject: [PATCH] feat(suggestions): group wip/banner/editor under a separate 'system' category MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit System tags are kind=general, so their suggestions previously landed in the General group. Give them their own 'system' suggestion category so the operator reviews them apart from content tags: _current_heads maps is_system heads to category 'system' (still trained as general heads, still gated by the 0.65 floor). Frontend: CATEGORY_ORDER/LABELS gain 'system'; SuggestionsPanel renders a 'System' group first (small, collapsible, open — false positives easy to spot and reject); the typed-dropdown shows the shield icon for system entries. Safe: system-tag suggestions always carry a canonical_tag_id, so the create-by-kind path (which would send 'system' as a TagKind) is never hit. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01CDgx8bQS5YrGRK76v8HUnM --- backend/app/services/ml/heads.py | 5 ++++- frontend/src/components/modal/SuggestionsPanel.vue | 10 ++++++++++ frontend/src/components/modal/TagAutocomplete.vue | 3 +++ frontend/src/stores/suggestions.js | 10 ++++++---- tests/test_ml_suggestions.py | 6 ++++-- 5 files changed, 27 insertions(+), 7 deletions(-) diff --git a/backend/app/services/ml/heads.py b/backend/app/services/ml/heads.py index 7143663..1f4d01a 100644 --- a/backend/app/services/ml/heads.py +++ b/backend/app/services/ml/heads.py @@ -326,7 +326,10 @@ async def _current_heads(session: AsyncSession, embedding_version: str): { "tag_id": r.tag_id, "name": r.name, - "category": _CATEGORY.get(r.kind, "general"), + # System tags (wip/banner/editor) are kind=general but group under + # their OWN "system" suggestion category so the operator reviews + # them apart from content tags (they still train as general heads). + "category": "system" if r.is_system else _CATEGORY.get(r.kind, "general"), "auto_apply_threshold": r.auto_apply_threshold, "is_system": bool(r.is_system), } diff --git a/frontend/src/components/modal/SuggestionsPanel.vue b/frontend/src/components/modal/SuggestionsPanel.vue index 50779d5..79f7ba6 100644 --- a/frontend/src/components/modal/SuggestionsPanel.vue +++ b/frontend/src/components/modal/SuggestionsPanel.vue @@ -16,6 +16,16 @@ of the rail (ImageViewer side layout), so a long suggestion set no longer needs an internal scroll cap to keep Related reachable. -->
+ +