From a01f3331df0bf68b52e125d5739f27066c3966f8 Mon Sep 17 00:00:00 2001 From: mawkone Date: Wed, 10 Jun 2026 11:38:49 -0700 Subject: [PATCH] chore(telemetry): implement robust path-confusion stall guard, persist verify signatures correctly, and redact secrets from telemetry logs --- vibn-frontend/app/api/chat/route.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/vibn-frontend/app/api/chat/route.ts b/vibn-frontend/app/api/chat/route.ts index 7c7768f..853ef8c 100644 --- a/vibn-frontend/app/api/chat/route.ts +++ b/vibn-frontend/app/api/chat/route.ts @@ -883,6 +883,13 @@ export async function POST(request: Request) { let toolCallsSinceText = 0; let loopBreakReason: string | null = null; + // ── Phase & Intent State ── + const turnIntent = classifyTurnIntent(message); + const maxToolRounds = activeMcpToken ? TOOL_BUDGETS[turnIntent] : 0; + let phase: AgentPhase = "recon"; + let checkpointEmitted = false; + let verificationPassed = false; + // ── Server-side conversational guard (C-03 enforcement) ─────────── // If the user's message looks conversational we withhold tools for // round 1. The model MUST respond in text first. If its reply then @@ -915,13 +922,6 @@ export async function POST(request: Request) { let fileHashes = new Map(); let stallRounds = 0; - // ── Phase & Intent State ── - const turnIntent = classifyTurnIntent(message); - const maxToolRounds = activeMcpToken ? TOOL_BUDGETS[turnIntent] : 0; - let phase: AgentPhase = "recon"; - let checkpointEmitted = false; - let verificationPassed = false; - emit({ type: "phase", phase, label: "Investigating & Planning" }); try {