Repository navigation
Conversation
|
Independent review: approve (with fixes, carried in #1503) Thank you @todie, this is a careful change. One real defect came up in review. The fix is in #1503, together with your two commits (authorship kept):
Smaller items:
Note for later: CI does not build the Gates on the merged tree: scoped tests for xerj-api (lib, plus decide_flywheel and systemone_local_decide with |
fix(api,common): escalate low-confidence history votes to the local decide tier (carries #1467)
|
Thank you @todie! This landed via #1503 (merged as c4c2084), with your two commits carried and your authorship intact. On top of them we added: a deterministic write-back id, so a question that escalates more than once keeps a single cached answer instead of piling up votes for the local head; documentation of |
…llow-up) Motivation: with xerj-org#1467's escalation, a split history vote is answered by the local head and written back. The same question asked again is often still split (its own cached answer is one neighbour among several), so it escalates again, and the write-back used a random UUID, so every repeat appended another document voting for the local head's label. Repetition alone could then out-vote the history, human corrections included. Fix: the write-back document id is `decide-<xxh3-128 of the text>`, so re-deciding the same text overwrites its single cached answer. Before: escalating "refund money back check" twice -> 4 docs (2 seeded + 2 identical cached answers). After: 3 docs, the cached one updated in place (new ts). Tests: unit write_back_id_is_one_per_decided_text; e2e (decide-local) re_escalating_the_same_question_keeps_one_cached_answer, verified to fail with the random-id write-back and pass with this change. Files: engine/crates/xerj-api/src/systemone_api.rs (write_back_id, spawn_write_back), engine/crates/xerj-api/tests/decide_flywheel.rs.
…erj-org#1094) The ladder section said history always wins when it has support; since xerj-org#1467 a split vote escalates to the armed local head below decisions.escalate_below. Documents the exception, its off switch, the choice-label caveat (the local head is near chance on untrained label vocabularies), the deterministic write-back id, and adds escalate_below to the config block.
Summary
Closes #1094
Unfreezes the decision flywheel once the
[decisions] indexhas BM25 support for common stop words by escalating split/low-confidence history votes (winning_share < escalate_below) toDecideTier::Localwhen the local tier is armed.Changes
[decisions] escalate_below(engine/crates/xerj-common/src/config.rs,engine/xerj.default.toml):escalate_below: f64(default0.8, matching the gate's confidence bar;0.0disables confidence escalation) and validated0.0..=1.0& finiteness inConfig::validate().132→133) acrossconfig.rs,lib.rs,xerj.default.toml, andproduct_experience.rs.engine/crates/xerj-api/src/systemone_api.rs):HistorySupport::Supported(f64)to carry the winning vote share (0.0..=1.0).resolve_tier(support: &HistorySupport, escalate_below: f64, local_enabled: bool) -> Option<DecideTier>soHistorySupport::Supported(share)escalates toSome(DecideTier::Local)whenlocal_enabled && *share < escalate_below, while preservingSome(DecideTier::History)when!local_enabledor*share >= escalate_below.HistorySupport::Supported(winning_share)andcfg.escalate_belowinto bothPOST /v1/systemoneandPOST /_decide, so escalated answers run through the local DeBERTa NLI head and cache their judgements into[decisions] indexwithout writing back tier-1 history votes.Verification
cargo test --manifest-path engine/Cargo.toml -j 2 -p xerj-common --lib configcargo test --manifest-path engine/Cargo.toml -j 2 -p xerj-api --lib systemone_apicargo test --manifest-path engine/Cargo.toml -j 2 -p xerj-api --features decide-local --test decide_flywheel --test systemone_local_decidecargo test --manifest-path engine/Cargo.toml -j 2 -p xerj-engine --test product_experience