Skip to content

refactor(router): route simple intents to workers_ai as primary executor#73

Merged
stackbilt-admin merged 2 commits into
mainfrom
auto/feature/issue-71
Jun 24, 2026
Merged

refactor(router): route simple intents to workers_ai as primary executor#73
stackbilt-admin merged 2 commits into
mainfrom
auto/feature/issue-71

Conversation

@stackbilt-admin

Copy link
Copy Markdown
Member

Closes #71

Changes

web/src/kernel/router.ts

  • DEFAULT_ROUTES: greeting, general_knowledge, tarot_pulse, tarot_trajectoryworkers_ai
  • selectDefaultExecutor: greeting fixed route now returns workers_ai
  • Verify zone (confidence 0.50–0.79): low-complexity no-tool → workers_ai (reverts the // workers_ai → gpt_oss bump)
  • Degraded procedure fallback: DEFAULT_ROUTES[classification] ?? 'claude'?? 'workers_ai'

web/tests/router.test.ts

  • 6 assertions updated to reflect the new routing targets
  • 5 new tests: general_knowledge, tarot_pulse, tarot_trajectory, tarot_deep, greeting baseline

Guardrails preserved

  • memory_recall stays on gpt_oss (equity recall failure 2026-03-04)
  • code_task stays on claude_code
  • Tool-requiring intents stay on gpt_oss
  • Complex/high-complexity escalation to claude/claude_opus unchanged

Test result

118/118 passing (executor-router regression + semantic + router)

Aegis and others added 2 commits June 23, 2026 09:04
)

Replaces the previous O(2N) sequential D1 edge traversal with a
2-query bulk snapshot (SELECT kg_nodes, SELECT kg_edges) fed into
@stackbilt/wasm-core WasmGraph.spreadActivation. Cuts D1 round
trips from 2N to a flat 2 regardless of graph size.

- activateGraph: Promise.all bulk load → WasmGraph BFS → free()
- vitest: vite-plugin-wasm + server.deps.inline for WASM in v4
- Tests: graph, recall-baseline, recall-pipeline, recall-mindspring
  all updated to new 2-query mock structure (1539 passed, 1 skipped)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tor (closes #71)

- DEFAULT_ROUTES: greeting, general_knowledge, tarot_pulse, tarot_trajectory → workers_ai
- selectDefaultExecutor: greeting fixed route → workers_ai
- Verify zone low-complexity no-tool → workers_ai (restoring intent behind // workers_ai → gpt_oss comment)
- Degraded procedure fallback: ?? 'claude' → ?? 'workers_ai'
- Router tests: 6 updated assertions + 5 new tests for changed routes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@stackbilt-admin stackbilt-admin left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APPROVED

The routing changes are correct and match the issue spec. Posting one structural note and one flag on the bundled scope.

Routing correctness (✓ all match spec)

  1. DEFAULT_ROUTESgreeting, general_knowledge, tarot_pulse, tarot_trajectoryworkers_ai (web/src/kernel/router.ts:102–113)
  2. memory_recall stays on gpt_oss with the equity-recall comment (router.ts:103) ✓
  3. Degraded fallback ?? 'claude'?? 'workers_ai' (router.ts:452) ✓
  4. Verify-zone low-complexity no-tool → workers_ai (router.ts:172) ✓ — reverting the previous intentional bump back to where the issue spec wants it
  5. selectDefaultExecutor greeting fixed-route updated to match (router.ts:137) ✓

Test coverage (✓)

  • New tests: general_knowledge, tarot_pulse, tarot_trajectory, tarot_deep (counter-test keeping gpt_oss), greeting baseline (router.test.ts:1096–1118)
  • Verify-zone test renamed + assertion updated (router.test.ts:1125, 1134)
  • Degraded-procedure and broken-procedure tests updated (router.test.ts:1152, 1162)
  • executor-router.test.ts untouched — correct, that file tests executor registration not dispatch routing

One structural note (non-blocking)

The internal trigger path at router.ts:219 and :240 still has ?? 'direct' as its unknown-classification fallback. The issue spec called out "line 452" specifically, so the internal path is arguably out of scope. Worth a follow-up issue if you want the internal path to also fall to workers_ai instead of direct for unknown classes — but it's a different semantic (internal triggers with unknown classifications are a different error condition than external routing misses).

Bundled scope flag

This PR bundles a substantial unrelated change: the graph.ts WasmGraph refactor (new @stackbilt/wasm-core dep, vite-plugin-wasm, vite-plugin-top-level-await, rewritten test fixtures across four test files). The WasmGraph WASM boundary introduces a test-correctness risk: the pruning test at recall-baseline.test.ts:708 now asserts expect(weak).toBeUndefined() against opaque WASM behavior — if WasmGraph.spreadActivation returns sub-threshold nodes, that assertion will fail with no clear signal. This isn't a blocker for the routing changes, but if the graph work ever needs to be rolled back independently, it can't be done cleanly. Consider whether this should have been a separate PR.

@stackbilt-admin stackbilt-admin merged commit 5374e34 into main Jun 24, 2026
1 of 2 checks passed
@stackbilt-admin stackbilt-admin deleted the auto/feature/issue-71 branch June 24, 2026 18:21
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.

feat(router): make workers_ai the default executor across classification routing table

1 participant