diff --git a/app/Console/Commands/SessionSummary.php b/app/Console/Commands/SessionSummary.php index eb0148e..daf9266 100644 --- a/app/Console/Commands/SessionSummary.php +++ b/app/Console/Commands/SessionSummary.php @@ -277,11 +277,17 @@ private function aggregateScenarioBand(array $runs): array ->selectRaw('sum(gen_tokens) / nullif(sum(wall), 0) as gen_tps') ->first(); + // Thinking level: keep it only when every scenario row in the band + // agrees — matches the per-run runLevel() rule, applied at band scope. + $level = DB::table('scenario_runs') + ->whereIn('benchmark_run_id', $runPks) + ->distinct()->pluck('level')->filter()->values(); + return [ 'run_pk' => $first->id, 'run_id' => $first->run_id, 'suite' => 'scenariobench', - 'level' => null, + 'level' => $level->count() === 1 ? $level->first() : null, 'passed' => (int) ($agg->passed ?? 0), 'failed' => (int) ($agg->failed ?? 0), 'avg_user_tps' => null,