Skip to content

fix: implement keyword-based routing in getTaskRoutingRecommendation#35

Merged
htafolla merged 2 commits intomasterfrom
fix/get-task-routing-recommendation
Mar 31, 2026
Merged

fix: implement keyword-based routing in getTaskRoutingRecommendation#35
htafolla merged 2 commits intomasterfrom
fix/get-task-routing-recommendation

Conversation

@htafolla
Copy link
Copy Markdown
Owner

Summary

  • Implement keyword-based task routing in getTaskRoutingRecommendation
  • Add Node.js type declarations to tsconfig.json

Problem

The getTaskRoutingRecommendation function insrc/enforcement/enforcer-tools.ts was a stub that returned empty suggestedSkill regardless of task complexity. This meant tasks were not being routed to appropriate agents/skills.

Additionally, the tsconfig.json was missing Node.js type declarations, causing hundreds of TS2307/TS2580 errors for built-in modules like fs, path, crypto, process, Buffer, and require.

Solution

Part 1: Keyword-based routing

  • Implemented keyword matching using the existing ROUTING_MAPPINGS array
  • Routes tasks to appropriate skills based on keywords (e.g., "test" → testing-lead, "security" → security-auditor)
  • Preserves fallback to orchestrator for unrecognized tasks

Part 2: TypeScript configuration

  • Added "types": ["node"] to tsconfig.json compilerOptions
  • Resolves all Node.js type declaration errors

Test plan

  • TypeScript typecheck passes with no errors
  • Existing tests continue to pass
  • Keyword routing correctly matches task descriptions to skills

Previously, getTaskRoutingRecommendation was a stub that returned empty
suggestedSkill and always routed to 'enforcer'. This fix implements
proper keyword-based routing that:

- Matches task descriptions against routing keywords
- Routes to appropriate agent/skill combinations
- Returns correct confidence levels
- Falls back to 'enforcer' with 'enforcer' skill when no match

This enables proper task delegation based on task description content.
- Add 'types: ["node"]' to compilerOptions
- Resolves TS2307 errors for Node.js built-in modules (fs, path, crypto, etc.)
- Resolves TS2580 errors for Node.js globals (process, Buffer, require)
@htafolla htafolla merged commit 40cdf34 into master Mar 31, 2026
12 of 13 checks passed
@htafolla htafolla deleted the fix/get-task-routing-recommendation branch March 31, 2026 16:35
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.

1 participant