feat(heads): auto-apply UI on the Concept-heads card (#114 auto-apply C)
CI / lint (push) Successful in 2s
CI / frontend-build (push) Successful in 20s
CI / backend-lint-and-test (push) Successful in 26s
CI / integration (push) Successful in 3m23s

Surfaces earned auto-apply + its observability in Settings → Tagging → Concept
heads:
- Auto-apply section: an on/off switch (writes head_auto_apply_enabled), the
  precision-target + min-examples-to-fire tuning inputs, a Preview (dry-run →
  "would apply N", per-concept chips) and Apply-now button, with live run state.
- "How auto-apply is landing": per-concept table from /api/heads/metrics —
  applied volume, misfires, realized misfire rate (green/amber/red), and missed
  (under-fires) — the signal to tune the precision target from.

store: autoApply(dryRun) / autoApplyStatus() / metrics(). Card polls the sweep
to completion, then refreshes counts + metrics. Completes the auto-apply task.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ttrj5P7upUTueSfoJcxEqa
This commit is contained in:
2026-06-29 00:51:59 -04:00
parent a5a95320df
commit 1463794778
2 changed files with 235 additions and 4 deletions
+18 -1
View File
@@ -20,5 +20,22 @@ export const useHeadsStore = defineStore('heads', () => {
return await api.post('/api/heads/train', { body: { params } })
}
return { status, train }
// Earned auto-apply: trigger a sweep. dry_run previews (writes nothing);
// a real sweep needs head_auto_apply_enabled on (else 400).
async function autoApply(dryRun = false) {
return await api.post('/api/heads/auto-apply', { body: { dry_run: dryRun } })
}
// Recent sweeps + per-concept report (volume / projected per head).
async function autoApplyStatus() {
return await api.get('/api/heads/auto-apply')
}
// Observability: per-concept counts (volume, misfires, under-fires, realized
// misfire rate, head quality) + the daily time-series, to tune from.
async function metrics() {
return await api.get('/api/heads/metrics')
}
return { status, train, autoApply, autoApplyStatus, metrics }
})