Purpose: Validate that OpenAgent and OpenCoder use ContextScout effectively to discover and load the RIGHT context at the RIGHT time.
Date: 2026-01-07
Status: Draft - Ready for Review
Task: "Write a new function to calculate fibonacci numbers"
Expected Behavior:
.opencode/context/core/standards/code.mdWhy: For standard tasks (code/docs/tests), agents already know the context path. ContextScout adds overhead without value.
Test:
name: "OpenCoder: Known Context - Direct Loading"
prompts:
- text: "Write a new function to calculate fibonacci numbers"
expectations:
- type: context_loaded
contexts: [".opencode/context/core/standards/code.md"]
- type: tool_not_called
tool: "task"
reason: "Should not delegate to ContextScout for known context"
- type: max_duration
value: 30000 # Should be fast without discovery
Task: "Find context files about eval framework testing patterns"
Expected Behavior:
.opencode/context/openagents-repo/core-concepts/evals.mdWhy: For domain-specific or unfamiliar topics, ContextScout discovers relevant files that agents might miss.
Test:
name: "OpenAgent: Unknown Domain - ContextScout Discovery"
prompts:
- text: "Find context files about eval framework testing patterns"
expectations:
- type: tool_called
tool: "task"
args_contain: "ContextScout"
- type: context_loaded
contexts: [".opencode/context/openagents-repo/core-concepts/evals.md"]
- type: max_duration
value: 60000 # Discovery adds time, but finds right context
Task: "Help me improve the documentation"
Expected Behavior:
Why: ContextScout helps agents understand what context exists when task is vague.
Test:
name: "OpenAgent: Ambiguous Task - ContextScout Clarification"
prompts:
- text: "Help me improve the documentation"
expectations:
- type: tool_called
tool: "task"
args_contain: "contextscout"
- type: output_contains
value: "documentation"
- type: behavior
check: "agent_asks_for_clarification OR agent_loads_relevant_context"
Task: "Create a new agent with tests and documentation"
Expected Behavior:
Why: Complex tasks need multiple context files. ContextScout ensures nothing is missed.
Test:
name: "OpenAgent: Multi-Domain - ContextScout Comprehensive Discovery"
prompts:
- text: "Create a new agent with tests and documentation"
expectations:
- type: tool_called
tool: "task"
args_contain: "contextscout"
- type: context_loaded
contexts:
- ".opencode/context/core/standards/code.md"
- ".opencode/context/core/standards/tests.md"
- ".opencode/context/core/standards/docs.md"
- ".opencode/context/openagents-repo/guides/adding-agent.md"
- type: loading_order
check: "critical_files_loaded_first"
Task A: "Write a function" (direct loading)
Task B: "Write a function" (with ContextScout discovery)
Expected Behavior:
Why: Measure the overhead of ContextScout for known tasks.
Test:
name: "Performance: Direct Loading vs. ContextScout Discovery"
variants:
- name: "direct"
force_behavior: "skip_contextscout"
expected_duration: 10000
- name: "discovery"
force_behavior: "use_contextscout"
expected_duration: 25000
comparison:
- type: duration_difference
max_overhead: 15000 # ContextScout should add <15s
Task: "Find context about MVI principles"
Expected Behavior:
.opencode/context/core/context-system/standards/mvi.mdWhy: Validate ContextScout's search accuracy.
Test:
name: "Accuracy: ContextScout Finds Correct Files"
prompts:
- text: "Find context about MVI principles"
expectations:
- type: tool_called
tool: "task"
args_contain: "contextscout"
- type: context_loaded
contexts: [".opencode/context/core/context-system/standards/mvi.md"]
- type: no_false_positives
check: "only_relevant_files_loaded"
Task: Run same task 5 times, check if agent uses ContextScout consistently
Expected Behavior:
Why: Agents should be predictable, not random.
Test:
name: "Predictability: Consistent ContextScout Usage"
iterations: 5
prompts:
- text: "Write a function to parse JSON" # Known task
expectations:
- type: consistency
check: "contextscout_usage_same_across_runs"
- type: expected_behavior
value: "never_uses_contextscout" # Known context path
| Scenario | Use ContextScout? | Why |
|---|---|---|
| Standard code task | ❌ NO | Path known: .opencode/context/core/standards/code.md |
| Standard docs task | ❌ NO | Path known: .opencode/context/core/standards/docs.md |
| Standard tests task | ❌ NO | Path known: .opencode/context/core/standards/tests.md |
| Domain-specific task | ✅ YES | Need to discover domain context (e.g., evals, registry) |
| Unfamiliar topic | ✅ YES | Don't know what context exists |
| Multi-domain task | ✅ YES | Need to find ALL relevant files |
| Ambiguous request | ✅ YES | Clarify what context is available |
| Error/troubleshooting | ✅ YES | Find error-specific guides |
Key Insight: ContextScout should be used for discovery (unknown domains), NOT for known paths (standard code/docs/tests). The test suite will validate this hypothesis.