gate: stop dropping lookups by carrying expectation + skills in the state
The binary gate asked "Does this input contain an actionable request?" over the raw text alone, so the model read information requests as small talk: "tell me the next event in my nextcloud calendar" scored 0.599 (under tau 0.6) and "what is the next event...?" scored 0.191, both dropped. The state now states that the user expects handling, that looking values up in a configured service is a real task, and lists the available skills; the question/options say handle/ignore. On the real model every lookup variant scores 0.9998+ while chatter stays at 0.016-0.125, and the new jarvis integration battery pins both sides.
This commit is contained in:
1 parent
b66d1e325a
commit
de2c1a73f2
5 files changed
+115
-8
No files matched your search
@@ -125,6 +125,42 @@ def test_pipeline_end_to_end(tmp_path):
|
||||
assert "queue:" in skills
|
||||
|
||||
|
||||
def test_gate_accepts_information_requests_and_rejects_noise(tmp_path):
|
||||
"""Regression: the gate must not drop lookups phrased as questions.
|
||||
|
||||
Before the gate state carried the end-user expectation and the available
|
||||
skills, "tell me the next event in my nextcloud calendar" scored 0.599
|
||||
(just under tau 0.6) and "what is the next event in my nextcloud calendar?"
|
||||
scored 0.191, so both were dropped as "no actionable request". All lookup
|
||||
variants must pass now, while chatter stays out.
|
||||
"""
|
||||
config = load_config()
|
||||
require_real(config)
|
||||
config["log"] = str(tmp_path / "decisions.jsonl")
|
||||
config["trace"] = str(tmp_path / "runs.jsonl")
|
||||
scheduler, config = build_scheduler(config)
|
||||
|
||||
lookups = [
|
||||
"tell me the next event in my nextcloud calendar",
|
||||
"what is the next event in my nextcloud calendar?",
|
||||
"what is the next event in my nextcloud calendar Morgan",
|
||||
"tell me the next event in my nextcloud calendar Morgan",
|
||||
"tell me the next even in my calendar",
|
||||
"tell me the next event in my personal calendar",
|
||||
]
|
||||
noise = ["hello there", "thanks!", "the sky is blue", "what's up"]
|
||||
for text in lookups:
|
||||
accepted = scheduler._contains_request(Request(text))
|
||||
row = scheduler.log.read()[-1]
|
||||
print(f"[lookup] {row['predicted_probs']} accepted={accepted} {text!r}")
|
||||
assert accepted, f"gate dropped a lookup: {text!r}"
|
||||
for text in noise:
|
||||
accepted = scheduler._contains_request(Request(text))
|
||||
row = scheduler.log.read()[-1]
|
||||
print(f"[noise] {row['predicted_probs']} accepted={accepted} {text!r}")
|
||||
assert not accepted, f"gate accepted noise: {text!r}"
|
||||
|
||||
|
||||
def test_busy_choice_path(tmp_path):
|
||||
config = load_config()
|
||||
require_real(config)
|
||||
|
||||
Reference in new issue
Block a user