Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/gittensory-mcp/bin/gittensory-mcp.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/signals/local-branch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
25 changes: 25 additions & 0 deletions test/unit/local-branch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
13 changes: 12 additions & 1 deletion test/unit/mcp-cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void>((resolve) => server?.close(() => resolve()));
server = null;
const url = await startFixtureServer({ packetMarkdown: `# Public-safe PR packet\n\n- ${unsafePhrase}\n` });
Expand Down