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
14 changes: 12 additions & 2 deletions honesty.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
28 changes: 28 additions & 0 deletions test/honesty.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});