Add dream-tunable balancedFloorKeywords to floor tool-intent queries at Balanced (#486)#489
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 ashighSignalKeywordsover-routes to expensive High and is stripped by theTopicBlocklist; threshold nudges can't move a ~0.0 query.Solution
A new dream-tunable
balancedFloorKeywordslist. When a user-message prompt matches a floor keyword and the computed tier is Low, escalate to Balanced (never High). Exempt fromTopicBlocklist— it is meant to hold topic/tool words. Seeded empty; the dream owns it.Changes
TierSelectorConfig— nullableBalancedFloorKeywordsproperty.KeywordTierSelector— compiled default (empty, add-only); merged via existingMergeKeywords(auto-exempt from the blocklist since the list name lacks"high"); Low→Balanced override inClassifyCoreafter the active-thread override, gated onOrigin == "user-message"andtier == Lowso 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 thepanicEscalationbullet, and keeps the "reject topic words" rule scoped tohighSignalKeywordsonly. Added the field to the response-format JSON example.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
KeywordTierSelectorTestspass (5 new).Deferred
Optional analyzer support (
balancedFloorCandidatesinTierRoutingAnalyzer) is not in the acceptance criteria — the dream can already derive candidates fromflaggedClusters[].samplePrompt. Skipped to keep the PR focused; can be a follow-up.Closes #486
🤖 Generated with Claude Code