You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provisional: posted after local work started. Nothing has been pushed yet. The automation posts the authoritative completion record after the push.
Scope
Remove the super-linear regex /([^\s<>,"']+@[a-z0-9.-]+\.[a-z]{2,})/i in extractSenderAddress_ (S8786, src/gmail-ai-classifier/src/index.js:1134) without changing behavior.
Implementation Checklist
src/gmail-ai-classifier/src/index.js: split the sender on the same delimiter class ([\s<>,"']+), then scan each token with small linear helpers (findPlainEmailInToken_, plainDomainMatchEnd_). These keep the old regex's leftmost-longest semantics: the last viable @, and the longest domain.tld with at least 2 letters in the TLD.
src/gmail-ai-classifier/code.gs: make the same change so the GAS copy stays in sync.
Export extractSenderAddress_ from both files so it can be tested.
Tests to Write
tests/sender-address.test.js, run against both code.gs and src/index.js:
table cases, each also asserted equal to the legacy regex
3000 seeded random inputs checked for parity with the legacy regex
an adversarial input that must finish in under 500ms (the legacy regex took about 24s locally)
The implementation for issue #665 is durable: commits are pushed and a pull request is open. This record is backed by verifiable artifacts you can confirm in one click.
Review happens on the PR. Acceptance criteria and test results are evidenced by the PR's diff and CI checks — not asserted here. If a later stage fails, this claim is retracted in place.
Activity
don-petry commentedon Nov 3, 2026
Dev-Lead Implementation Plan
Issue: #665 — SonarCloud: JavaScript/TypeScript code quality
Scope
Remove the super-linear regex
/([^\s<>,"']+@[a-z0-9.-]+\.[a-z]{2,})/iinextractSenderAddress_(S8786,src/gmail-ai-classifier/src/index.js:1134) without changing behavior.Implementation Checklist
src/gmail-ai-classifier/src/index.js: split the sender on the same delimiter class ([\s<>,"']+), then scan each token with small linear helpers (findPlainEmailInToken_,plainDomainMatchEnd_). These keep the old regex's leftmost-longest semantics: the last viable@, and the longestdomain.tldwith at least 2 letters in the TLD.src/gmail-ai-classifier/code.gs: make the same change so the GAS copy stays in sync.extractSenderAddress_from both files so it can be tested.Tests to Write
tests/sender-address.test.js, run against bothcode.gsandsrc/index.js:Test Command
npm test/npx jest --coverage,npm run checkdon-petry commentedon Nov 3, 2026
Dev-Lead: Implementation Complete — PR #666
The implementation for issue #665 is durable: commits are pushed and a pull request is open. This record is backed by verifiable artifacts you can confirm in one click.
148feaa79ba8c8f064407b4ac3dbe3035584ce30main: 3 file(s), +194/-4 linesReview happens on the PR. Acceptance criteria and test results are evidenced by the PR's diff and CI checks — not asserted here. If a later stage fails, this claim is retracted in place.