Workload Analysis
The Workload Analysis Layer inspects the developer’s workspace context, active files, project structure, language, and complexity, to build a Workload Profile that describes what kind of work the request entails.
What Is a Workload Profile?
Section titled “What Is a Workload Profile?”A workload profile is a structured snapshot of the task at hand. It includes:
| Field | Description | Source |
|---|---|---|
language | Detected programming language(s) | File extension + heuristics |
stack | Framework or runtime identified | repo/intelligence/profiler.ts |
complexityLevel | Estimated complexity (1-5) | complexityLevel() in workload/analyzer.ts |
contextBucket | Size of context window needed | Message length + attachment size |
outputBucket | Expected response length | Keyword prediction in workload/signals.ts |
executionPriority | urgency × complexity × cost sensitivity | deriveExecutionPriority() in workload/analyzer.ts |
confidence | How certain the analysis is | computeConfidence() in workload/analyzer.ts |
The Analysis Pipeline
Section titled “The Analysis Pipeline”Classified Intent | v[1] Scan Active Files --> Detect language, stack, file count | v[2] Assess Complexity --> complexityLevel(), classifyComplexity() | v[3] Measure Context --> contextBucket, outputBucket estimates | v[4] Compute Priority --> deriveExecutionPriority() | v[5] Build Workload Snapshot -> buildWorkloadSnapshot()Complexity Assessment
Section titled “Complexity Assessment”The complexity engine looks at:
- Message length, longer prompts suggest more complex tasks
- File attachments,
.ts,.tsx,.py,.rsfiles carry different complexity weights - Multi-step indicators, keywords like “and then”, “after that”, “in addition” indicate multi-step reasoning
- Domain keywords, “architecture”, “refactor”, “design pattern” score higher than “variable name”
Signal Functions
Section titled “Signal Functions”Key functions in workload/signals.ts:
| Function | Purpose |
|---|---|
extractComplexityScore() | Scans request text for complexity keywords |
extractLatencySensitivity() | Detects urgency cues (“quick”, “now”, “ASAP”) |
extractCostSensitivity() | Detects budget-conscious language (“cheap”, “cost”, “save”) |
estimateContextSize() | Measures message + attachment tokens |
predictOutputLength() | Predicts response length from keywords (“short”, “detailed”, “comprehensive”) |
predictToolUsage() | Detects agentic language implying tool calls |
detectWorkflowStyle() | Classifies as interactive, agentic, or batch |
computeCodingWeight() | Weights coding-specific signals higher than general chat |
File Reference
Section titled “File Reference”| File | What It Does |
|---|---|
workload/analyzer.ts | Main analysis orchestrator. Builds the complete workload profile |
workload/signals.ts | Signal extraction library. Pure functions for text analysis |
workload/types.ts | TypeScript types for workload profiles, signals, and buckets |
repo/intelligence/profiler.ts | Repository-level profiling. Detects monorepo structure, identifies stack |
repo/intelligence/scanner.ts | File system scanner. Walks workspace to detect languages and frameworks |
Integration with Downstream Layers
Section titled “Integration with Downstream Layers”The workload profile feeds into:
- Strategy Engine, workload complexity determines which strategy is selected
- Provider Scoring, context bucket size filters out models with small context windows
- Economics, cost sensitivity from workload analysis caps the budget ceiling
- Execution, execution priority determines timeout profiles and retry policies