name: ‘step-03-quality-evaluation’ description: ‘Orchestrate adaptive quality dimension checks (agent-team, subagent, or sequential)’
Select execution mode deterministically, then evaluate quality dimensions using agent-team, subagent, or sequential execution while preserving output contracts:
Coverage is intentionally excluded from this workflow and handled by trace.
{communication_language}tea_execution_mode, tea_capability_probe)Generate unique timestamp:
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
Prepare context for all subagents:
const parseBooleanFlag = (value, defaultValue = true) => {
if (typeof value === 'string') {
const normalized = value.trim().toLowerCase();
if (['false', '0', 'off', 'no'].includes(normalized)) return false;
if (['true', '1', 'on', 'yes'].includes(normalized)) return true;
}
if (value === undefined || value === null) return defaultValue;
return Boolean(value);
};
const subagentContext = {
test_files: /* from Step 2 */,
knowledge_fragments_loaded: ['test-quality'],
config: {
execution_mode: config.tea_execution_mode || 'auto', // "auto" | "subagent" | "agent-team" | "sequential"
capability_probe: parseBooleanFlag(config.tea_capability_probe, true), // supports booleans and "false"/"true" strings
},
timestamp: timestamp
};
const normalizeUserExecutionMode = (mode) => {
if (typeof mode !== 'string') return null;
const normalized = mode.trim().toLowerCase().replace(/[-_]/g, ' ').replace(/\s+/g, ' ');
if (normalized === 'auto') return 'auto';
if (normalized === 'sequential') return 'sequential';
if (normalized === 'subagent' || normalized === 'sub agent' || normalized === 'subagents' || normalized === 'sub agents') {
return 'subagent';
}
if (normalized === 'agent team' || normalized === 'agent teams' || normalized === 'agentteam') {
return 'agent-team';
}
return null;
};
const normalizeConfigExecutionMode = (mode) => {
if (mode === 'subagent') return 'subagent';
if (mode === 'auto' || mode === 'sequential' || mode === 'subagent' || mode === 'agent-team') {
return mode;
}
return null;
};
// Explicit user instruction in the active run takes priority over config.
const explicitModeFromUser = normalizeUserExecutionMode(runtime.getExplicitExecutionModeHint?.() || null);
const requestedMode = explicitModeFromUser || normalizeConfigExecutionMode(subagentContext.config.execution_mode) || 'auto';
const probeEnabled = subagentContext.config.capability_probe;
const supports = {
subagent: false,
agentTeam: false,
};
if (probeEnabled) {
supports.subagent = runtime.canLaunchSubagents?.() === true;
supports.agentTeam = runtime.canLaunchAgentTeams?.() === true;
}
let resolvedMode = requestedMode;
if (requestedMode === 'auto') {
if (supports.agentTeam) resolvedMode = 'agent-team';
else if (supports.subagent) resolvedMode = 'subagent';
else resolvedMode = 'sequential';
} else if (probeEnabled && requestedMode === 'agent-team' && !supports.agentTeam) {
resolvedMode = supports.subagent ? 'subagent' : 'sequential';
} else if (probeEnabled && requestedMode === 'subagent' && !supports.subagent) {
resolvedMode = 'sequential';
}
subagentContext.execution = {
requestedMode,
resolvedMode,
probeEnabled,
supports,
};
Resolution precedence:
agent team => agent-team; subagent => subagent; sequential; auto)tea_execution_mode from configIf probing is disabled, honor the requested mode strictly. If that mode cannot be executed at runtime, fail with explicit error instead of silent fallback.
Subagent A: Determinism
./step-03a-subagent-determinism.md/tmp/tea-test-review-determinism-${timestamp}.jsonagent-team or subagent: launch non-blockingsequential: run blocking and waitSubagent B: Isolation
./step-03b-subagent-isolation.md/tmp/tea-test-review-isolation-${timestamp}.jsonSubagent C: Maintainability
./step-03c-subagent-maintainability.md/tmp/tea-test-review-maintainability-${timestamp}.jsonSubagent D: Performance
./step-03e-subagent-performance.md/tmp/tea-test-review-performance-${timestamp}.jsonIn agent-team and subagent modes, runtime decides worker scheduling and concurrency.
If resolvedMode is agent-team or subagent:
⏳ Waiting for 4 quality subagents to complete...
✅ All 4 quality subagents completed successfully!
If resolvedMode is sequential:
✅ Sequential mode: each worker already completed during dispatch.
const outputs = ['determinism', 'isolation', 'maintainability', 'performance'].map(
(dim) => `/tmp/tea-test-review-${dim}-${timestamp}.json`,
);
outputs.forEach((output) => {
if (!fs.existsSync(output)) {
throw new Error(`Subagent output missing: ${output}`);
}
});
🚀 Performance Report:
- Execution Mode: {resolvedMode}
- Total Elapsed: ~mode-dependent
- Parallel Gain: ~60-70% faster when mode is subagent/agent-team
Pass the same timestamp value to Step 3F (do not regenerate it). Step 3F must read the exact temp files written in this step.
Load next step: {nextStepFile}
The aggregation step (3F) will:
Proceed to Step 3F when:
Do NOT proceed if any subagent failed.
Master Rule: Deterministic mode selection + stable output contract. Use the best supported mode, then aggregate normally.