From 8e89209a27969b5ccc23ffc6312dc740578cd921 Mon Sep 17 00:00:00 2001 From: Variet Worker Date: Tue, 14 Apr 2026 06:05:43 +0900 Subject: [PATCH] =?UTF-8?q?fix(observer):=20template=20literal=20regex=20e?= =?UTF-8?q?scaping=20=E2=80=94=20\s/\d=20had=20wrong=20backslash=20count?= =?UTF-8?q?=20(v0.5.41)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Root cause: regex literals inside template literal (\...\) need exactly 2 backslashes (\\s, \\d) to produce \s, \d in the output. The v9 code had 4 backslashes (\\\\s) which produced literal \\s in the browser (matching backslash+s instead of whitespace class). This broke: - 'Running N commands' skip pattern (never matched) - NOISE_CODE_RE (declare/import line filters) - cleanLines() pre-strip word boundary \\b and split/join \\n - cleanButtonText() whitespace strip \\s The fix restores all regex-literal patterns to exactly 2 backslashes. new RegExp() string patterns (like NOISE_RE) already used 4 backslashes correctly (string→regex has one extra escaping layer). Verified: node eval of generated code confirms /^Running\s*\d+\s*commands?$/i correctly matches 'Running2 commands' and 'Running 4 commands'. #task-619 #task-620 --- extension/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extension/package.json b/extension/package.json index c02bd1b..642018c 100644 --- a/extension/package.json +++ b/extension/package.json @@ -2,7 +2,7 @@ "name": "gravity-bridge", "displayName": "Gravity Bridge", "description": "Discord-based unified approval system for Antigravity AI interactions.", - "version": "0.5.40", + "version": "0.5.41", "publisher": "variet", "engines": { "vscode": "^1.100.0"