Skip to content

Add dream-tunable balancedFloorKeywords to floor tool-intent queries at Balanced (#486)#489

Merged
rockfordlhotka merged 1 commit into
mainfrom
issue-486/balanced-floor-keywords
Jul 22, 2026
Merged

Add dream-tunable balancedFloorKeywords to floor tool-intent queries at Balanced (#486)#489
rockfordlhotka merged 1 commit into
mainfrom
issue-486/balanced-floor-keywords

Conversation

@rockfordlhotka

Copy link
Copy Markdown
Member

Problem

Short user queries that need a tool (e.g. "what's on my todo list?") score ~0.0 and route Low, where the small model fails to pick the right MCP tool under heavy injected context. The keyword router is a cognitive-complexity classifier — blind to "this needs a tool." The dream detects the problem (panicEscalation) but had no lever: adding topic words as highSignalKeywords over-routes to expensive High and is stripped by the TopicBlocklist; threshold nudges can't move a ~0.0 query.

Solution

A new dream-tunable balancedFloorKeywords list. When a user-message prompt matches a floor keyword and the computed tier is Low, escalate to Balanced (never High). Exempt from TopicBlocklist — it is meant to hold topic/tool words. Seeded empty; the dream owns it.

Changes

  • TierSelectorConfig — nullable BalancedFloorKeywords property.
  • KeywordTierSelector — compiled default (empty, add-only); merged via existing MergeKeywords (auto-exempt from the blocklist since the list name lacks "high"); Low→Balanced override in ClassifyCore after the active-thread override, gated on Origin == "user-message" and tier == Low so it structurally cannot reach High; floor count added to the reload log.
  • routing-dream.md — documents the lever as job 4, cross-references it from the panicEscalation bullet, and keeps the "reject topic words" rule scoped to highSignalKeywords only. Added the field to the response-format JSON example.
  • Tests — 5 new: Low→Balanced escalation (user origin), no effect for subagent origin, never-High, non-matching trivial chat stays Low, and the TopicBlocklist-exemption proof.

Risk

Low — purely additive. The empty default means zero behavior change until the dream (or an operator) populates the list. Existing routing paths untouched.

Verification

Full solution builds with 0 errors; all 78 KeywordTierSelectorTests pass (5 new).

Deferred

Optional analyzer support (balancedFloorCandidates in TierRoutingAnalyzer) is not in the acceptance criteria — the dream can already derive candidates from flaggedClusters[].samplePrompt. Skipped to keep the PR focused; can be a follow-up.

Closes #486

🤖 Generated with Claude Code

…at Balanced (#486)

Short user queries that need a tool (e.g. "what's on my todo list?") score
near-zero and route Low, where the small model fails to pick the right MCP
tool under heavy injected context. The dream detects this (panicEscalation)
but had no lever: topic words in highSignalKeywords over-route to High and
are stripped by the TopicBlocklist; threshold nudges can't move a ~0.0 query.

Add a dream-tunable balancedFloorKeywords list. When a user-message prompt
matches a floor keyword and the computed tier is Low, escalate to Balanced
(never High). Exempt from the TopicBlocklist by design — it holds topic/tool
words. Seeded empty; the dream owns it, so behavior is unchanged until
populated.

- TierSelectorConfig: nullable BalancedFloorKeywords property
- KeywordTierSelector: compiled default (empty), merge (auto-exempt from
  blocklist since list name lacks "high"), Low->Balanced override in
  ClassifyCore, floor count in reload log
- routing-dream.md: document the lever as job 4; keep the reject-topic-words
  rule scoped to highSignalKeywords only
- Tests: escalation, subagent no-op, never-High, non-match stays Low,
  blocklist exemption

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rockfordlhotka
rockfordlhotka merged commit c289ca9 into main Jul 22, 2026
2 checks passed
@rockfordlhotka
rockfordlhotka deleted the issue-486/balanced-floor-keywords branch July 22, 2026 04:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Routing: add dream-tunable balancedFloorKeywords so tool-intent queries don't land on the weak Low tier

1 participant