feat: local-encoder accuracy rebuild — eval harness, CLS pooling, trainable head #100

Merged
alee merged 9 commits from feat/local-encoder-accuracy-rebuild into main 2026-09-23 20:23:58 +00:00

9 Commits

Author SHA1 Message Date
adlee-was-taken
d28003e4bf docs(config): record why tier_from_features has no admin control yet
Both fields are read nowhere outside config.py; item E is a design
sketch only. An admin toggle would control nothing real until that
feature is implemented. The existing gap in
test_admin_knob_coverage.py (the whole classifier.* section sits
outside the generic registries) is pre-existing and not addressed
here.
2026-09-23 16:20:19 -04:00
adlee-was-taken
27043046a6 fix(local-encoder): dispatch pooling strategy by model_id, not load order
_mean_pool(token_embeddings, attention_mask) reads
list(_model_pooling_strategies.values())[-1] — the last-inserted
value — instead of the strategy belonging to the model whose
embeddings are being pooled. This works today because production
loads one encoder per process and every test populates at most one
dict entry, but breaks silently the moment two backbones share a
process.

Fix: thread model_id through _mean_pool and its call sites
(_build_description_embeddings and _embed_task), resolving the
strategy via _model_pooling_strategies.get(model_id, 'mean')
instead of reading the global tail.

Add test_mean_pool_dispatches_by_model_id_not_load_order which
proves the failure mode is closed: two models with different
strategies (cls, mean) are each pooled correctly regardless of
which was inserted first.
2026-09-23 16:20:15 -04:00
adlee-was-taken
c4534946e8 docs(local-encoder): document confidence_min, eval_classifier harness, and trainable head 2026-09-23 01:26:30 -04:00
adlee-was-taken
02d6361c81 fix(local-encoder): update test references from confidence_threshold to confidence_min 2026-09-23 01:22:59 -04:00
adlee-was-taken
44b919b297 feat(local-encoder): trainable LogisticRegression head with synthetic corpus 2026-09-23 01:22:36 -04:00
adlee-was-taken
28f81b3d16 feat(local-encoder): tier-from-features sketch with config keys and stub class 2026-09-23 01:02:07 -04:00
adlee-was-taken
ea6bde6cda fix(local-encoder): rename confidence_threshold to confidence_min, add deprecation alias 2026-09-23 00:49:17 -04:00
adlee-was-taken
b98608a4b8 feat(local-encoder): CLS pooling + per-model query prefix from model snapshot 2026-09-23 00:28:42 -04:00
adlee-was-taken
5a90b0e68e feat(eval): eval_classifier.py harness with 46-task labeled set and noise variants 2026-09-23 00:14:06 -04:00