From f523dfb554647f90b181407a0786832d53778576 Mon Sep 17 00:00:00 2001 From: David Montero Date: Wed, 17 Jun 2026 20:52:10 +0200 Subject: [PATCH] chore(sim): log circuit pre-flight verification outcome (observability) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Verification failing silently in production is otherwise hard to spot — the rules read 0 A when branch currents are missing. Log the errors/warnings, whether a solve landed, and which branch/node vectors came back. --- frontend/src/components/editor/EditorToolbar.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/editor/EditorToolbar.tsx b/frontend/src/components/editor/EditorToolbar.tsx index 36feaeb4..e0433967 100644 --- a/frontend/src/components/editor/EditorToolbar.tsx +++ b/frontend/src/components/editor/EditorToolbar.tsx @@ -639,7 +639,20 @@ export const EditorToolbar = ({ }), }; const input = buildInputFromStore(snap); - return await verifyCircuit(input); + const result = await verifyCircuit(input); + // Concise outcome log — verification failing silently in production is + // hard to spot otherwise (the rules read 0 A when currents are missing). + console.log( + '[verify]', + JSON.stringify({ + errors: result.errors.map((e) => e.code), + warnings: result.warnings.map((w) => w.code), + solved: !!result.solve, + branches: result.solve ? Object.keys(result.solve.branchCurrents) : null, + nodes: result.solve ? Object.keys(result.solve.nodeVoltages) : null, + }), + ); + return result; } catch (err) { console.warn('[verifyCircuit] failed', err); return null;