feat(heads): admin card to train + inspect concept heads (#114 B)
The UI for the heads subsystem: Settings → Tagging → "Concept heads". Shows head count, auto-apply-ready count, and last-trained; a Train/Retrain button (one run at a time, polls while running, surfaces a failed run's error); an empty state guiding the operator to tag first; and a per-concept table (name, category, +tags, AP, P, R, auto-apply ⚡) sorted strongest-first so weak/under- tagged concepts are obvious. Rehydrates status from GET /api/heads on mount so it survives navigation. Pulls head_min_positives from ML settings for copy. Slice C (swap the rail's suggestions to heads, remove Camie + centroid) is next. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ttrj5P7upUTueSfoJcxEqa
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
import { useApi } from '../composables/useApi.js'
|
||||
|
||||
// Heads (#114): the per-concept classifiers that LEARN from your tags and power
|
||||
// suggestions (replacing Camie + centroid). Training runs as a background task;
|
||||
// the card rehydrates status from GET /api/heads on mount so it survives
|
||||
// navigation (the run lives in head_training_run server-side).
|
||||
export const useHeadsStore = defineStore('heads', () => {
|
||||
const api = useApi()
|
||||
|
||||
// Summary: head_count, graduated_count, last_trained_at, running_id, the
|
||||
// per-concept head table, and recent training runs.
|
||||
async function status() {
|
||||
return await api.get('/api/heads')
|
||||
}
|
||||
|
||||
// (Re)train all eligible heads. One run at a time (409 if already running).
|
||||
async function train(params = {}) {
|
||||
return await api.post('/api/heads/train', { body: { params } })
|
||||
}
|
||||
|
||||
return { status, train }
|
||||
})
|
||||
Reference in New Issue
Block a user