diff --git a/packages/gittensory-mcp/bin/gittensory-mcp.js b/packages/gittensory-mcp/bin/gittensory-mcp.js index 59edf3b952..2f172686e7 100755 --- a/packages/gittensory-mcp/bin/gittensory-mcp.js +++ b/packages/gittensory-mcp/bin/gittensory-mcp.js @@ -1339,7 +1339,7 @@ function requirePublicSafePacketMarkdown(markdown) { } function isUnsafePublicPacketText(value) { - return /\b(reward\w*|score\w*|wallet|hotkey|coldkey|mnemonic|farming|payout|ranking|raw[-_\s]?trust|trust[-_\s]?score|private[-_\s]?reviewability|reviewability)\b|\/Users\/|\/home\/|\/tmp\/|[A-Z]:\\Users\\/i.test(value); + return /\b(reward\w*|score\w*|wallet|hotkey|coldkey|mnemonic|farming|payout|ranking|raw[-_\s]?trust|trust[-_\s]?score|private[-_\s]?reviewability|reviewability)\b|\/Users\/|\/home\/|\/tmp\/|[A-Z]:[\\/]Users[\\/]/i.test(value); } function printVersion(options) { diff --git a/src/signals/local-branch.ts b/src/signals/local-branch.ts index f2bd132e46..edd6bd63fc 100644 --- a/src/signals/local-branch.ts +++ b/src/signals/local-branch.ts @@ -1162,7 +1162,7 @@ function firstCommitTitle(messages: string[] | undefined): string | undefined { } function isPublicSafeText(text: string): boolean { - return !/\b(reward\w*|score\w*|wallet|hotkey|coldkey|mnemonic|farming|payout|ranking|raw[-_\s]?trust|trust[-_\s]?score|private[-_\s]?reviewability|reviewability)\b|\/Users\/|\/home\/|\/tmp\/|[A-Z]:\\Users\\/i.test(text); + return !/\b(reward\w*|score\w*|wallet|hotkey|coldkey|mnemonic|farming|payout|ranking|raw[-_\s]?trust|trust[-_\s]?score|private[-_\s]?reviewability|reviewability)\b|\/Users\/|\/home\/|\/tmp\/|[A-Z]:[\\/]Users[\\/]/i.test(text); } function safeRepoPath(path: string): string { diff --git a/test/unit/local-branch.test.ts b/test/unit/local-branch.test.ts index eb8bb2746a..c348e144bc 100644 --- a/test/unit/local-branch.test.ts +++ b/test/unit/local-branch.test.ts @@ -1092,6 +1092,31 @@ describe("local branch analysis", () => { expect(JSON.stringify(analysis.prPacket)).not.toMatch(/reward|score|wallet|hotkey|farming|payout|ranking|trust score|\/Users\/example/i); }); + it("removes Windows home paths from public PR packet title and validation lines", () => { + const analysis = buildLocalBranchAnalysis({ + input: { + login: "oktofeesh1", + repoFullName: repo.fullName, + title: "Fix cache failure from C:\\Users\\alice\\workspace", + body: "Fixes #7", + changedFiles: [{ path: "src/cache.ts", additions: 12, deletions: 2, status: "modified" }], + validation: [ + { command: "npm test C:\\Users\\alice\\workspace\\cache.log", status: "passed", summary: "log at C:\\Users\\alice\\workspace\\cache.log" }, + ], + }, + repo, + issues: [{ repoFullName: repo.fullName, number: 7, title: "Cache refresh fails", state: "open", labels: ["bug"], linkedPrs: [] }], + pullRequests: [], + profile, + outcomeHistory, + scoringSnapshot, + scoringProfile, + }); + + expect(analysis.prPacket.markdown).toContain("## Validation"); + expect(analysis.prPacket.markdown).not.toMatch(/C:\\Users\\alice/i); + }); + it("removes snake_case private signals from public PR packet markdown", () => { const analysis = buildLocalBranchAnalysis({ input: { diff --git a/test/unit/mcp-cli.test.ts b/test/unit/mcp-cli.test.ts index f8ca2dc28c..c1a2a2e64a 100644 --- a/test/unit/mcp-cli.test.ts +++ b/test/unit/mcp-cli.test.ts @@ -890,7 +890,18 @@ describe("gittensory-mcp CLI", () => { git(tempDir, "commit", "-m", "initial commit"); git(tempDir, "checkout", "-b", "codex/public-safe-pr-packets"); - for (const unsafePhrase of ["score: 1.15", "reward estimate", "wallet address", "hotkey id", "raw-trust: 0.7", "private-reviewability: ready", "raw_trust: 0.7", "private_reviewability: ready", "trust_score: 0.4"]) { + for (const unsafePhrase of [ + "score: 1.15", + "reward estimate", + "wallet address", + "hotkey id", + "raw-trust: 0.7", + "private-reviewability: ready", + "raw_trust: 0.7", + "private_reviewability: ready", + "trust_score: 0.4", + "log path C:\\Users\\alice\\workspace\\raw.log", + ]) { if (server) await new Promise((resolve) => server?.close(() => resolve())); server = null; const url = await startFixtureServer({ packetMarkdown: `# Public-safe PR packet\n\n- ${unsafePhrase}\n` });