mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-15 23:31:04 +00:00
4.7 KiB
4.7 KiB
Phase 1 End-to-End Testing Guide
This guide helps you test the complete Phase 1 implementation: Intent Selection with Trace Entry Lookup.
Automated Tests
Run the unit tests:
cd src
npx vitest run core/tools/__tests__/selectActiveIntentTool.spec.ts
The test suite verifies:
- ✅ Intent loading from
active_intents.yaml - ✅ Trace entry lookup from
agent_trace.jsonl - ✅ XML context generation with recent history
- ✅ Intent filtering (only relevant traces)
- ✅ Error handling for missing intents
Manual Testing Workflow
Step 1: Prepare Test Environment
- Ensure you have an intent in
active_intents.yaml:
active_intents:
- id: INT-001
name: Test Intent
status: IN_PROGRESS
owned_scope:
- src/test/**
constraints:
- Must follow test patterns
acceptance_criteria:
- All tests pass
- Create a test trace entry in
agent_trace.jsonl:
{
"id": "trace-1",
"timestamp": "2026-02-18T10:00:00Z",
"vcs": { "revision_id": "abc123" },
"files": [
{
"relative_path": "src/test/file1.ts",
"conversations": [
{
"url": "task-1",
"contributor": { "entity_type": "AI", "model_identifier": "claude-3-5-sonnet" },
"ranges": [{ "start_line": 10, "end_line": 20, "content_hash": "sha256:hash1" }],
"related": [{ "type": "intent", "value": "INT-001" }]
}
]
}
]
}
Step 2: Test Intent Selection
- Open VS Code with the Roo Code extension
- Start a new chat/task
- Ask the agent to select an intent:
Please select intent INT-001
- Verify the agent calls
select_active_intenttool
Step 3: Verify Context Injection
After the agent calls select_active_intent, check:
-
The tool result should contain XML context:
<intent_id>INT-001</intent_id><intent_name>Test Intent</intent_name><owned_scope>,<constraints>,<acceptance_criteria><recent_history>with trace entries
-
The recent history should show:
- File paths from trace entries
- Line ranges
- Timestamps
Step 4: Test Code Writing with Intent
- After intent selection, ask the agent to write code:
Now create a test file in src/test/example.test.ts
- Verify:
- Agent can write code (intent is selected)
- Post-hook logs trace entry to
agent_trace.jsonl - New trace entry references INT-001
Step 5: Test Trace Entry Lookup
- Select the same intent again:
Select intent INT-001 again
- Verify:
- The
<recent_history>now includes the file you just created - Shows the new trace entry with file path and line ranges
- The
Expected Behavior
✅ Success Flow
- Agent calls
select_active_intent("INT-001") - Tool loads intent from YAML ✅
- Tool fetches trace entries from JSONL ✅
- Tool returns XML context with intent + history ✅
- Agent receives context and can write code ✅
- Post-hook logs new trace entry ✅
- Next intent selection includes new trace ✅
❌ Error Cases
-
Missing Intent:
- Agent calls
select_active_intent("INT-999") - Tool returns error: "Intent not found in active_intents.yaml"
- Agent calls
-
Missing Parameter:
- Agent calls
select_active_intent("") - Tool returns missing parameter error
- Agent calls
-
No Trace Entries:
- Intent exists but no traces
- XML shows: "No recent changes found for this intent"
Verification Checklist
- Intent loads from
active_intents.yaml - Trace entries are fetched from
agent_trace.jsonl - XML context includes intent specification
- XML context includes recent history
- Trace entries are filtered by intent ID
- Recent entries are sorted (newest first)
- Task stores
activeIntentIdandactiveIntent - Error handling works for missing intents
- Code writing works after intent selection
- Post-hook logs new trace entries
- New traces appear in next intent selection
Troubleshooting
Issue: Trace entries not appearing
Check:
agent_trace.jsonlexists and is readable- Trace entries have
relatedarray withtype: "intent"and matchingvalue - JSON is valid (one entry per line)
Issue: Intent not found
Check:
active_intents.yamlexists in.orchestration/- YAML syntax is valid
- Intent ID matches exactly (case-sensitive)
Issue: XML context missing history
Check:
- Trace entries reference the correct intent ID
getTraceEntriesForIntent()is being called- Trace entries have valid timestamps
Next Steps
After verifying Phase 1 works:
- ✅ Phase 1 Complete
- Generate PDF report for interim submission
- Document architectural decisions
- Create diagrams of hook system