P1 — make RuntimeHost own semantic command routing and remove duplicated LLM prompt authority #160

Closed
opened 2026-08-22 21:53:18 +00:00 by lost-rob0t · 0 comments
lost-rob0t commented 2026-08-22 21:53:18 +00:00 (Migrated from github.com)

Parent epic: #150
Depends on: #159
Integrates with: #82/#83, #122, current AgentManager/tool registry.

Goal

Make the post-client-split runtime route user utterances through one semantic service boundary before conversational fallback, rather than relying on AgentManager system-prompt instructions that duplicate a command-verb list and tell the model to call query_prolog.

Required architecture

  • RuntimeHost/backend owns the typed resolve -> dialogue -> plan -> execute/fallback orchestration established by #154-#159;
  • clients submit ordinary typed user turns and do not own Prolog/provider stacks in daemon mode;
  • deterministic Prolog command resolution happens before LLM conversational fallback according to the designed policy;
  • #122 rewrite, if enabled, runs only at its bounded pre-resolver location;
  • LLM may still use tools normally for conversational/tool work, but prompt text is not the authoritative command router;
  • Prolog is accessed through a service boundary, not from Qt/ZMQ/client widgets;
  • runtime emits structured intent/dialogue/plan/action events suitable for UI/voice/inspector without leaking hidden reasoning;
  • cancellation/stale turn semantics cover resolver/dialogue/provider work.

Migration

Remove or demote duplicated command verb/prompt routing only after tests prove equivalent/better behavior. Preserve standalone compatibility during migration as owned by #133/#134.

Tests

  • deterministic command never requires an LLM call;
  • conversational question does not get hijacked into command execution;
  • ambiguous/missing command produces clarification event, not arbitrary agent guess;
  • failed/unavailable deterministic provider may produce explicit failure or designed conversational fallback, never hidden shell fallback;
  • tools remain available in conversational agent path;
  • cancel while resolving/planning/executing prevents stale action/event/history append;
  • two principals and two conversations remain isolated;
  • provider/Prolog unavailable gives bounded typed degradation;
  • old command corpus parity and intentional differences documented.

Gates

TDD; focused runtime semantic-routing integration script; fake LLM asserts zero calls for deterministic examples; full repo/Nix, coverage and exact-head Actions.

Acceptance

There is one runtime-owned semantic command pipeline shared by daemon clients, while the LLM prompt no longer serves as duplicated command-routing authority.

Parent epic: #150 Depends on: #159 Integrates with: #82/#83, #122, current AgentManager/tool registry. ## Goal Make the post-client-split runtime route user utterances through one semantic service boundary before conversational fallback, rather than relying on AgentManager system-prompt instructions that duplicate a command-verb list and tell the model to call `query_prolog`. ## Required architecture - RuntimeHost/backend owns the typed resolve -> dialogue -> plan -> execute/fallback orchestration established by #154-#159; - clients submit ordinary typed user turns and do not own Prolog/provider stacks in daemon mode; - deterministic Prolog command resolution happens before LLM conversational fallback according to the designed policy; - #122 rewrite, if enabled, runs only at its bounded pre-resolver location; - LLM may still use tools normally for conversational/tool work, but prompt text is not the authoritative command router; - Prolog is accessed through a service boundary, not from Qt/ZMQ/client widgets; - runtime emits structured intent/dialogue/plan/action events suitable for UI/voice/inspector without leaking hidden reasoning; - cancellation/stale turn semantics cover resolver/dialogue/provider work. ## Migration Remove or demote duplicated command verb/prompt routing only after tests prove equivalent/better behavior. Preserve standalone compatibility during migration as owned by #133/#134. ## Tests - deterministic command never requires an LLM call; - conversational question does not get hijacked into command execution; - ambiguous/missing command produces clarification event, not arbitrary agent guess; - failed/unavailable deterministic provider may produce explicit failure or designed conversational fallback, never hidden shell fallback; - tools remain available in conversational agent path; - cancel while resolving/planning/executing prevents stale action/event/history append; - two principals and two conversations remain isolated; - provider/Prolog unavailable gives bounded typed degradation; - old command corpus parity and intentional differences documented. ## Gates TDD; focused runtime semantic-routing integration script; fake LLM asserts zero calls for deterministic examples; full repo/Nix, coverage and exact-head Actions. ## Acceptance There is one runtime-owned semantic command pipeline shared by daemon clients, while the LLM prompt no longer serves as duplicated command-routing authority.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nsaspy/zara#160
No description provided.