navigation: skip confirms on a confident softmax; per-skill humanize; 500ms VAD
Four latency/ergonomics changes from the voice-gateway diagnosis:
1. Per-skill humanize override. A skill's own recorded config
(data/skills/<cat>/<name>/config.json -> {"humanize": bool}) now wins over
the per-platform and global defaults, so an already-speakable result
(time.now) can skip the rewrite. The gateway resolves the skill ref from the
result summary; `_finish_run` now emits `category.name: ok — …` (matching the
assessment summary) so the ref is available. Missing store/config/key and
test doubles degrade to the existing platform/global behavior.
2. Example voice endpointing: vad.silence_ms 1000 -> 500 (config.example.json).
3. Confident softmax winners skip their confirm guard. New
navigation.softmax_bypass_tau (default 0.5): a category winner at/above it
skips confirm_category_fit (trace `category_scope_bypassed`); a leaf winner
at/above it is handed to dispatch and skips confirm_skill_fit (trace
`intent_bypass`). Below the threshold the two-stage confirm is unchanged.
Assumption tested first on the decision log: 28/28 category and 28/28 leaf
winners >= 0.5 agreed with their guard.
4. Engine-throughput investigation saved to AGENTS.md "Later / open questions"
(routing/assessment compute dominates; profile the engine, not the audio).
Tests updated for the bypass threshold and added for the skill-level humanize
override and bypass paths. Full suite: 486 passed, 1 skipped.
This commit is contained in:
1 parent
5bb0e9d21d
commit
d0c1dccffd
7 files changed
+256
-16
No files matched your search
@@ -225,6 +225,10 @@ class Scheduler:
|
||||
self.intent_tau = float(nav_cfg.get("intent_tau", 0.6))
|
||||
self.category_tau = float(nav_cfg.get("category_tau", 0.75))
|
||||
self.action_tau = float(nav_cfg.get("action_tau", 0.5))
|
||||
#: A softmax winner at or above this probability skips its confirm guard
|
||||
#: (scope/intent) — the winner is already decisive. Below it the guard
|
||||
#: runs and can reject into create.
|
||||
self.bypass_tau = float(nav_cfg.get("softmax_bypass_tau", 0.5))
|
||||
self.max_reentries = max_reentries
|
||||
self.codegen = codegen
|
||||
self.degeneration_check_factory = degeneration_check_factory
|
||||
@@ -416,6 +420,10 @@ class Scheduler:
|
||||
# ---- dispatch ----
|
||||
|
||||
def _dispatch(self, request: Request) -> DispatchResult:
|
||||
# Clear any confidence a prior dispatch left on the request (meta is
|
||||
# copied across a requeue); navigation sets it fresh when a leaf softmax
|
||||
# runs.
|
||||
request.meta.pop("leaf_softmax_prob", None)
|
||||
# Explicit housekeeping commands are deterministic: they route straight
|
||||
# to the meta skill, bypassing the generic guards (which misread a
|
||||
# task-like skill name as the task). Natural-language phrasings still go
|
||||
@@ -443,6 +451,7 @@ class Scheduler:
|
||||
self.tree,
|
||||
category_tau=self.category_tau,
|
||||
action_tau=self.action_tau,
|
||||
bypass_tau=self.bypass_tau,
|
||||
)
|
||||
if isinstance(navigation, CreateCategory):
|
||||
return self._dispatch_create_category(request)
|
||||
@@ -456,6 +465,17 @@ class Scheduler:
|
||||
# navigation's pick directly (the meta skill asks for any missing
|
||||
# target as an input variable).
|
||||
return self._run_skill(navigation, request)
|
||||
leaf_prob = request.meta.pop("leaf_softmax_prob", None)
|
||||
if leaf_prob is not None and leaf_prob >= self.bypass_tau:
|
||||
# A decisive leaf softmax winner skips the intent confirm.
|
||||
self.trace.append(
|
||||
"intent_bypass",
|
||||
request.id,
|
||||
category=navigation.category,
|
||||
skill=navigation.name,
|
||||
prob=leaf_prob,
|
||||
)
|
||||
return self._run_skill(navigation, request)
|
||||
if not confirm_skill_fit(
|
||||
self.engine, self.log, self.trace, request, navigation, self.intent_tau
|
||||
):
|
||||
@@ -653,7 +673,8 @@ class Scheduler:
|
||||
return DispatchResult(
|
||||
kind="ran",
|
||||
summary=(
|
||||
f"{skill.name}: {'ok' if outcome.success else 'failed'} — "
|
||||
f"{skill.category}.{skill.name}: "
|
||||
f"{'ok' if outcome.success else 'failed'} — "
|
||||
f"{outcome.action_log or outcome.summary}"
|
||||
),
|
||||
skill=skill.name,
|
||||
|
||||
Reference in new issue
Block a user