diff --git a/tests/runner-e2e/chat-catalog-domains/external-company-secret.test.ts b/tests/runner-e2e/chat-catalog-domains/external-company-secret.test.ts index d8f18f5299a..f9142d7e80e 100644 --- a/tests/runner-e2e/chat-catalog-domains/external-company-secret.test.ts +++ b/tests/runner-e2e/chat-catalog-domains/external-company-secret.test.ts @@ -134,3 +134,9 @@ it("distinguishes a dash-separated chat request from a plain warning", () => { expect(deploymentSecretGuidance(context + "Do not paste your credential into files — send it here in chat.")).toBe(false); expect(deploymentSecretGuidance(context + "Do not paste your credential into files — keep it private.")).toBe(true); }); + +it("accepts secure entry with a separate negative chat warning", () => { + const context = "Use secure settings for Morgan's deployment credential environment binding. "; + expect(deploymentSecretGuidance(context + "Choose Set my value and enter your publishing key there — don't paste it in chat.")).toBe(true); + expect(deploymentSecretGuidance(context + "Choose Set my value and enter your publishing key there — paste it in chat.")).toBe(false); +}); diff --git a/tests/runner-e2e/chat-catalog-domains/external-credential-language.test.ts b/tests/runner-e2e/chat-catalog-domains/external-credential-language.test.ts index 9944a233ae4..94d6fb65048 100644 --- a/tests/runner-e2e/chat-catalog-domains/external-credential-language.test.ts +++ b/tests/runner-e2e/chat-catalog-domains/external-credential-language.test.ts @@ -88,3 +88,8 @@ it("resets an explicit request after a dash while retaining a plain prohibition" expect(solicitsChatCredential("You must never paste or share your credential here.")).toBe(false); expect(solicitsChatCredential("Do not paste your credential into files — keep it private.")).toBe(false); }); + +it("separates secure entry from its dash-prefixed negative chat warning", () => { + expect(solicitsChatCredential("Choose Set my value and enter your publishing key there — don't paste it in chat.")).toBe(false); + expect(solicitsChatCredential("Choose Set my value and enter your publishing key there — paste it in chat.")).toBe(true); +}); diff --git a/tests/runner-e2e/chat-catalog-domains/external-credential-language.ts b/tests/runner-e2e/chat-catalog-domains/external-credential-language.ts index 712d5a9652a..4f3ed449074 100644 --- a/tests/runner-e2e/chat-catalog-domains/external-credential-language.ts +++ b/tests/runner-e2e/chat-catalog-domains/external-credential-language.ts @@ -21,7 +21,7 @@ function positiveCredentialRequest(clause: string, hasKeyContext: boolean, needs * checked separately, including a carried key reference such as "send it here". */ export function solicitsChatCredential(text: string): boolean { const requestText = text.replace(/\band\s+instead\s+(?=(?:please\s+)?(?:paste|send|share|provide|enter)\b)/gi, "but ") - .replace(/(?:[—–]\s*|\s+-\s+)(?=(?:please\s+)?(?:paste|send|share|provide|enter)\b)/gi, " but "); + .replace(/(?:[—–]\s*|\s+-\s+)(?=(?:please\s+)?(?:(?:you\s+)?(?:(?:do|should|must|can|could|will|would)\s+not|don.t|never|not)\s+)?(?:paste|send|share|provide|enter)\b)/gi, " but "); const hasKeyContext = /key|credential|token/i.test(text); if (requestText.split(/[.!?;\n]+/).some(sentence => { const parts = sentence.split(/\b(?:but|however|then)\b/i); diff --git a/tests/runner-e2e/chat-catalog-domains/external-personal-secret.test.ts b/tests/runner-e2e/chat-catalog-domains/external-personal-secret.test.ts index d3e9e4cf9f7..02203560123 100644 --- a/tests/runner-e2e/chat-catalog-domains/external-personal-secret.test.ts +++ b/tests/runner-e2e/chat-catalog-domains/external-personal-secret.test.ts @@ -266,3 +266,9 @@ it("distinguishes a dash-separated chat request from a plain warning", () => { expect(personalSecretGuidance(context + "Do not paste your credential into files — send it here in chat.")).toBe(false); expect(personalSecretGuidance(context + "Do not paste your credential into files — keep it private.")).toBe(true); }); + +it("accepts secure entry with a separate negative chat warning", () => { + const context = 'Open secure personal publishing settings. '; + expect(personalSecretGuidance(context + "Choose Set my value and enter your publishing key there — don't paste it in chat.")).toBe(true); + expect(personalSecretGuidance(context + "Choose Set my value and enter your publishing key there — paste it in chat.")).toBe(false); +});