โ† deemwar engineering examples Runnable ยท Node ยท zero deps ยท free

It looks like your payload. It's actually your account.

A send starts failing โ€” or an account gets restricted โ€” right after some unrelated-looking change: a new link format, a longer message, an emoji. The natural hypothesis is "my payload triggered this." Often it's account-class policy instead: many platforms enforce more strictly on new or low-reputation accounts, and the rejection reads identically to a payload problem from the client side.

The crux

function serverPolicy(accountClass, payload) {
  if (accountClass === 'new' && payload.hasLink) {
    return { accepted: false, reason: 'policy: unverified accounts cannot send links' };
  }
  return { accepted: true, reason: null };
}

Nothing in that function reads the payload's format โ€” only whether it has a link, and the account's class. Reformatting the link, wrapping it differently, changing the message length โ€” none of it touches the variable that actually decides the outcome. The only way to tell a payload bug from an account-class policy is a controlled experiment: hold the payload fixed, vary the account.

Run it

node check.js --demo

Zero dependencies, no network โ€” runs the wrong experiment first (three payload reformats, same account, all rejected), then the right one (one unmodified payload, two account classes).

$ node check.js --demo Hypothesis A: "it is something about how the link is formatted." variant 1 (new account): accepted=false variant 2 (new account): accepted=false variant 3 (new account): accepted=false Every payload variant was rejected on the same account. Payload was never the variable. Now hold the ORIGINAL payload fixed and vary the account instead: new account, same payload -> accepted=false (policy: unverified accounts cannot send links) established account, same payload -> accepted=true (ok) DIAGNOSIS: the identical, unmodified payload succeeds from one account and fails from another. The discriminating variable was account class the whole time -- every hour spent reformatting the payload was testing the wrong axis.

The fix

Check your own incident

Get the code