From 344bca1a8ed0e7e80da3df3d9103a8f807ae8525 Mon Sep 17 00:00:00 2001 From: Harsh Singh Date: Sun, 11 Oct 2026 01:13:10 +0530 Subject: [PATCH] Catch a promise to tell the team when it is written with "I'll" The staff-lie filter removed "I will make sure the team sees this" but not "I'll make sure the team sees this": the pattern read "i (will|I'll)", so the contraction never matched. Promises in the future tense were not covered at all, so "I'll let the team know" and "I'll flag this to support" reached the customer though nobody had been told. Both forms are caught now, with a straight or a curly apostrophe. --- honesty.js | 14 ++++++++++++-- test/honesty.test.js | 28 ++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/honesty.js b/honesty.js index 86463c4..b4df176 100644 --- a/honesty.js +++ b/honesty.js @@ -1,9 +1,19 @@ +// The same promise in the future tense: "I'll let the team know", "I will flag this to support". +const WILL = "\\bi(?: will|['’]ll| am going to|['’]m going to) (?:also |just |now |go ahead and )?"; +const TEAM = '(?:the |our |a |an )?(?:omi )?(?:team|staff|support|engineers?|developers?|devs|person|human|someone)\\b'; + const LIE_PATTERNS = [ - /i('ve| have) (already )?(spoken|talked|reached out|messaged|emailed|pinged|informed|notified|escalated)/i, + /i(['’]ve| have) (already )?(spoken|talked|reached out|messaged|emailed|pinged|informed|notified|escalated)/i, + new RegExp(`${WILL}(?:let|tell|notify|inform|ping|alert|message|email|contact) ${TEAM}`, 'i'), + new RegExp( + `${WILL}(?:flag|forward|escalate|pass|send|raise|report|hand) (?:this|it|that|(?:your|the) \\w+)(?: (?:on|along|over|up))? (?:to|with|for) ${TEAM}`, + 'i' + ), + new RegExp(`${WILL}escalate\\b`, 'i'), /conveyed your (message|issue|problem)/i, /higher[- ]ups/i, /the (upper )?team has been (notified|informed)/i, - /i (will|I'll) (make sure|ensure) (the team|staff|someone)/i, + /\bi(?: will|['’]ll) (make sure|ensure) (the team|staff|someone)/i, /ticket has been (created|opened|filed)/i, /i (just )?contacted (support|staff|aarav|the team)/i, /passing this along/i, diff --git a/test/honesty.test.js b/test/honesty.test.js index ab41e52..8fcfc21 100644 --- a/test/honesty.test.js +++ b/test/honesty.test.js @@ -838,3 +838,31 @@ test('the same message id is only claimed once', () => { assert.equal(claimMessage('forum-starter-1'), false); assert.equal(claimMessage('forum-starter-2'), true); }); + +test('a promise to tell the team is a staff lie in the future tense too', () => { + for (const line of [ + "I'll make sure the team sees this.", + 'I’ll make sure someone gets back to you.', + "I'll let the team know about this.", + 'I will notify support right away.', + "I'll flag this to the team.", + "I'll forward this to support.", + "I'll escalate this for you.", + 'I am going to pass this on to the engineers.', + ]) { + assert.equal(looksLikeStaffLie(line), true, line); + assert.equal(stripStaffLies(`Restart the app first. ${line}`), 'Restart the app first.', line); + } +}); + +test('an offer the customer can act on is not a staff lie', () => { + for (const line of [ + "I'll tell you how to contact support.", + "I'll explain what the red light means.", + 'If that fails, let the team know in this thread.', + 'You can email help@omi.me and a person will look at it.', + 'I will send you the steps to reset the device.', + ]) { + assert.equal(looksLikeStaffLie(line), false, line); + } +});