From c04fc069786cfc33b8ec0a26aa766183a3f73cfa Mon Sep 17 00:00:00 2001 From: Duy Nguyen Date: Thu, 15 Oct 2026 18:27:13 +0700 Subject: [PATCH] test(personal-kits): use a neutral home in the shared proposal vectors Replace the sample user home with /home/alice in the shared kit-proposal policy vectors, the detector cost test, and the matching path-detector comment. Detection behavior is unchanged. --- .../personal-kits/proposal-path-detector.ts | 2 +- .../proposal-detector-cost.test.ts | 2 +- .../kit-proposal-policy-vectors-v1.json | 38 +++++++++---------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/apps/web/app/lib/personal-kits/proposal-path-detector.ts b/apps/web/app/lib/personal-kits/proposal-path-detector.ts index af50770..141ac6c 100644 --- a/apps/web/app/lib/personal-kits/proposal-path-detector.ts +++ b/apps/web/app/lib/personal-kits/proposal-path-detector.ts @@ -43,7 +43,7 @@ const LOCAL_PATHS: ReadonlyArray = [ /\b(?:file|smb):[\\/]/i, // An editor or IDE link to a file: vscode://file/..., cursor://file/... /\b[a-z][a-z0-9+.-]{0,31}:(?:\\*\/){2}file[\\/:]/i, - // A user home on the remote side of an ssh or sftp URL (ssh://kai@devbox/home/kai). + // A user home on the remote side of an ssh or sftp URL (ssh://kai@devbox/home/alice). /\b(?:ssh|sftp|scp|git\+ssh|svn\+ssh):(?:\\*\/){2}[^\s/\\"'<>`]*(?:\\*\/)+(?:home|Users|root)(?![A-Za-z0-9_-])/i, // A bare user, temp, mount or volume root, after any non-path character (also `\/home`). new RegExp(String.raw`${START}${SEP}(?:home|Users|root|mnt|media|Volumes|var${SEP}folders|tmp|private|run${SEP}user)(?![\p{L}\p{N}_-])`, "iu"), diff --git a/apps/web/tests/personal-kits/proposal-detector-cost.test.ts b/apps/web/tests/personal-kits/proposal-detector-cost.test.ts index 9452ec4..b043338 100644 --- a/apps/web/tests/personal-kits/proposal-detector-cost.test.ts +++ b/apps/web/tests/personal-kits/proposal-detector-cost.test.ts @@ -80,7 +80,7 @@ describe("detector cost on hostile input", () => { }); it("still finds a path or secret at the end of a hostile run", () => { - expect(hasLocalPath(fill("/") + "home/kai")).toBe(true); + expect(hasLocalPath(fill("/") + "home/alice")).toBe(true); expect(hasLocalPath(fill("a-") + " /srv/x/y")).toBe(true); expect(genericSecrets(fill("eyJ-") + " " + ["eyJ", "hbGciOiJIUzI1NiJ9", ".eyJ", "zdWIiOiIxIn0", ".c2ln"].join(""))).toEqual(["secret-jwt"]); }); diff --git a/packages/contracts/src/fixtures/kit-proposal-policy-vectors-v1.json b/packages/contracts/src/fixtures/kit-proposal-policy-vectors-v1.json index b3d3ea0..1537aa9 100644 --- a/packages/contracts/src/fixtures/kit-proposal-policy-vectors-v1.json +++ b/packages/contracts/src/fixtures/kit-proposal-policy-vectors-v1.json @@ -394,15 +394,15 @@ "d:/data/file", "share \\\\srv01\\public\\x", "\"\\\\\\\\srv01\\\\share\\\\x\"", - "file:///home/kai/x", + "file:///home/alice/x", "file://host/share", "/mnt/c/Users/kai", - ">/home/kai/log", - "/home/alice/log", + "