diff --git a/src/signals/focus-manifest.ts b/src/signals/focus-manifest.ts index 8f88745c51..727173140a 100644 --- a/src/signals/focus-manifest.ts +++ b/src/signals/focus-manifest.ts @@ -179,7 +179,7 @@ const EMPTY_MANIFEST: FocusManifest = { * text must not leak reward, wallet/key, ranking, or local filesystem path material. */ export function isFocusManifestPublicSafe(text: string): boolean { - return !/\b(reward\w*|score\w*|wallet|hotkey|coldkey|mnemonic|farming|payout|ranking|raw[-\s]?trust|trust score|private[-\s]?reviewability|reviewability)\b|\/Users\/|\/home\/|\/tmp\/|[A-Z]:\\Users\\/i.test(text); + return !/\b(reward\w*|score\w*|wallets?|hotkeys?|coldkeys?|seed[-\s]?phrases?|mnemonics?|private[-\s]?keys?|farming|payouts?|rankings?|raw[-\s]?trust(?:[-\s]?scores?)?|trust[-\s]?scores?|private[-\s]?reviewability|reviewability(?:[-\s]?internals?)?|private[-\s]?scoreability|scoreability|public[-\s]?score[-\s]?(?:estimate|prediction|claim)s?|estimated[-\s]?scores?|score[-\s]?(?:estimate|prediction|preview)s?)\b|\/Users\/|\/home\/|\/tmp\/|[A-Z]:\\Users\\/i.test(text); } function emptyManifest(source: FocusManifestSource, warnings: string[] = []): FocusManifest { diff --git a/test/unit/focus-manifest.test.ts b/test/unit/focus-manifest.test.ts index 49889c54a9..65366b59fb 100644 --- a/test/unit/focus-manifest.test.ts +++ b/test/unit/focus-manifest.test.ts @@ -911,6 +911,19 @@ describe("parseFocusManifest review config", () => { expect(m.warnings.some((w) => /review\.note.*public-safe/.test(w))).toBe(true); }); + it("drops review override terms covered by the public comment sanitizer", () => { + const m = parseFocusManifest({ + review: { + footer: { text: "Maintainer note: include seed phrase details." }, + note: "Intro note mentions private rankings.", + }, + }); + expect(m.review.footerText).toBeNull(); + expect(m.review.note).toBeNull(); + expect(m.warnings.some((w) => /review\.footer\.text.*public-safe/.test(w))).toBe(true); + expect(m.warnings.some((w) => /review\.note.*public-safe/.test(w))).toBe(true); + }); + it("ignores invalid field toggles and non-mapping footer/fields with warnings", () => { const m = parseFocusManifest({ review: { footer: ["nope"], fields: "nope" } }); expect(m.review.present).toBe(false); diff --git a/test/unit/policy-sanitizer.test.ts b/test/unit/policy-sanitizer.test.ts index 5ff9e0251e..ad68478ee9 100644 --- a/test/unit/policy-sanitizer.test.ts +++ b/test/unit/policy-sanitizer.test.ts @@ -395,12 +395,16 @@ describe("compileFocusManifestPolicy — public-safe output boundaries", () => { "hotkey abc123", "coldkey xyz", "mnemonic phrase", + "seed phrase", + "private key", "payout estimate", "reward estimate value", "raw trust score", "trust score context", "farming strategy", "private reviewability", + "private rankings", + "rankings", "score context", "scored output", ];