feat(classifier): soft confidence band and shadow encoder labeler (both OFF by default) #115
Reference in New Issue
Block a user
Delete Branch "feat/classifier-reliability"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Classifier reliability lift, both waves.
Wave 1: soft confidence band (OFF by default)
classifier.decision.soft_confidence_min(None = off, byte-for-byte today's behaviour). A local_decision answer with confidence in [soft floor, confidence_min) is used as sourceclassifier_softinstead of being discarded for a stale session_history / fallback label.classifier_softis not written to the session cache, is non-attributable for outcomes, counts toward the degraded-share warning, and persistsclassifier_reject = below_confidence_min.Wave 2: shadow encoder (OFF by default)
classifier.shadow_encoder(default false; config load fails if true with no encoder block). Runs the local encoder off the response path via a background task for every routed chat decision and records its label into the newclassifier_shadowtable. Observe only: never read by routing, never touches the session cache or classifier backoff. Single-flight lock released in a finally; failures are swallowed and counted as rows.scripts/shadow_report.py(read-only, 6 sections).Verification
Deploy notes
classifier_shadowis created lazily on first write (CREATE TABLE IF NOT EXISTS) and is also in schema.sql.Known follow-ups: session_history has no age bound; a tier overlay for turns below the soft floor.
🤖 Generated with Claude Code
https://claude.ai/code/session_01XtPLeRkmHJk4VeiTEUfhVR