Convention: What testing pattern should be used for agent loop regressio...

Documentation for Sessions

📏 Convention: What testing pattern should be used for agent loop regressio...

Date: 2026-03-11
Time: 04:21:37 UTC
Session: gspace1-202.8
Agent: testing
Confidence: 95%
Status: ✅ Documented


📋 Decision Context

Question:

What testing pattern should be used for agent loop regression tests?

Task: S202 golden path test convention


🎯 Decision Made

Chosen:

Fixture-driven golden path tests at APIs/backend-vitto-api/src/app/engine/tests/golden-paths/. Each scenario defines: input (message, layer, complexity, toolFilter), llmResponses (sequence of mocked LLM outputs with tool calls), toolResults (keyed by tool call ID), expected assertions (outputContains, expectedToolCalls, forbiddenToolCalls, maxIterations, completedViaTaskComplete, stuckDetected). Mock tool calls must use { id, function: { name, arguments } } format. getToolsForUser() returns { tools, unavailableNote }. ToolSecurityService mock needs sanitizeOutput(). Run gate: all 28 tests must pass before any Phase 4+ agent runtime refactor.

Options Considered:

  1. Fixture-driven golden path (chosen)
  2. Integration tests with real MongoDB
  3. Snapshot testing
  4. Manual QA checklist

💭 Reasoning

The golden path tests are the behavioral regression gate specified in the plan. Without them, refactoring the agent loop or checkpoint system could subtly break 15% of workflows with no detection mechanism. The fixture format is extensible — add new scenarios by appending to GOLDEN_PATH_SCENARIOS array.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation