From: Jérôme Benoit Date: Thu, 7 May 2026 23:33:21 +0000 (+0200) Subject: refactor(sandcastle): remove redundant lastFindings from LoopResult X-Git-Tag: cli@v4.7.0~3 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=6dec3647bf859d037bb2566d76ca7249e95cd7a1;p=e-mobility-charging-stations-simulator.git refactor(sandcastle): remove redundant lastFindings from LoopResult Derive last-round findings from roundHistory.at(-1)?.findings in finalizer.ts instead of maintaining a separate field. The PR body now shows all critic findings from the final round (including LOW confidence) for full transparency. --- diff --git a/.sandcastle/finalizer.ts b/.sandcastle/finalizer.ts index 665ae825..f4518239 100644 --- a/.sandcastle/finalizer.ts +++ b/.sandcastle/finalizer.ts @@ -51,9 +51,10 @@ export function buildPrArgs ( ): { isDraft: boolean; prArgs: string[] } { const converged = loopResult.status === 'converged' const isDraft = !converged || !validationPassed + const lastFindings = loopResult.roundHistory.at(-1)?.findings ?? [] const outstandingNote = - loopResult.lastFindings.length > 0 - ? `\n\n${converged ? 'ℹ️ Known findings (not addressed):' : '⚠️ Outstanding findings:'}\n${loopResult.lastFindings.map(f => `- [${f.severity}] ${f.file}: ${f.title}`).join('\n')}` + lastFindings.length > 0 + ? `\n\n${converged ? 'ℹ️ Known findings (not addressed):' : '⚠️ Outstanding findings:'}\n${lastFindings.map(f => `- [${f.severity}] ${f.file}: ${f.title}`).join('\n')}` : '' const validationNote = !validationPassed ? '\n\n⚠️ Validation did not pass. Manual review required.' diff --git a/.sandcastle/refinement-loop.ts b/.sandcastle/refinement-loop.ts index dcb2c89a..98c6fea3 100644 --- a/.sandcastle/refinement-loop.ts +++ b/.sandcastle/refinement-loop.ts @@ -231,7 +231,6 @@ export async function runRefinementLoop ( return { baseBranch, failureReason, - lastFindings, roundHistory, roundsCompleted, status, diff --git a/.sandcastle/types.ts b/.sandcastle/types.ts index 950660f7..9fe1d737 100644 --- a/.sandcastle/types.ts +++ b/.sandcastle/types.ts @@ -47,12 +47,7 @@ export interface LoopResult { baseBranch: string /** Reason for non-converged termination, if applicable. */ failureReason?: string - /** Outstanding findings from the last round. */ - lastFindings: Finding[] - /** - * Complete findings history across all rounds. - * Authoritative source — `lastFindings` is kept for backward compatibility. - */ + /** Complete findings history across all rounds. */ roundHistory: RoundSnapshot[] /** Number of main-loop rounds completed (excludes post-loop validation retry). */ roundsCompleted: number