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: 2 additions & 0 deletions src/services/miner-dashboard-recommendations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const REASON_LIMIT = 3;
const FORBIDDEN_PUBLIC_TEXT =
/\b(wallets?|hotkeys?|coldkeys?|seed phrases?|mnemonics?|private keys?|raw[-_\s]?trust(?: scores?)?|trust[-_\s]?scores?|reward(?:[-_\s]?(?:estimate|prediction|claim|score))?s?|payouts?|farming(?:[-_\s]?language)?|private[-_\s]?reviewability|private[-_\s]?scoreability|scoreability|public[-_\s]?score[-_\s]?(?:estimate|prediction)|estimated[-_\s]?score|score[-_\s]?estimate)\b/gi;
const LOCAL_PATH = /(?:\/(?:Users|home|root|tmp|var)\/[^\s,;:)]+|[A-Za-z]:\\Users\\[^\s,;:)]+)/g;
const FORBIDDEN_TOKEN = /\b(?:ghp_|github_pat_|gts_|glpat-|sk-)[A-Za-z0-9_=-]{8,}/g;
Comment thread
JSONbored marked this conversation as resolved.

export function previousDecisionPackFromSnapshots(currentPack: ContributorDecisionPack, snapshots: SignalSnapshotRecord[]): ContributorDecisionPack | undefined {
const current = asRecord(currentPack);
Expand Down Expand Up @@ -383,6 +384,7 @@ function numberValue(record: DashboardRecord | undefined, key: string): number |
function sanitizePublicText(value: string): string {
return value
.replace(LOCAL_PATH, "[local path]")
.replace(FORBIDDEN_TOKEN, "private context")
.replace(FORBIDDEN_PUBLIC_TEXT, "private context")
.replace(/\s+/g, " ")
.trim();
Expand Down
2 changes: 1 addition & 1 deletion test/unit/miner-dashboard-recommendations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe("miner dashboard recommendation metadata", () => {
{
repoFullName: "JSONbored/gittensory",
actionKind: "open_new_direct_pr",
rerunWhen: "Rerun when queue changes, not wallet hotkey scoreability reward estimate.",
rerunWhen: "Rerun when queue changes, not wallet hotkey scoreability reward estimate ghp_abcd1234EFGH5678ijkl.",
},
],
},
Expand Down