Skip to content

Open-source AI browser agent for Chrome and Firefox (monorepo) 🧠

fix(social-publish): reject neither destinations

Barack Sokulluccd9b143ebcf
diff --git a/src/chrome/src/agent/agent.js b/src/chrome/src/agent/agent.js
index 09444e888..93b892781 100644
--- a/src/chrome/src/agent/agent.js
+++ b/src/chrome/src/agent/agent.js
@@ -257,7 +257,7 @@ const SOCIAL_POST_NEGATION = new RegExp(
'iu',
);
const SOCIAL_POST_DESTINATION_NEGATION = new RegExp(
- `(?<![${SOCIAL_WORD_EDGE}])not(?![${SOCIAL_WORD_EDGE}])\\s+(?:on|onto|to|via|in|at)(?![${SOCIAL_WORD_EDGE}])`,
+ `(?<![${SOCIAL_WORD_EDGE}])(?:not\\s+(?:on|onto|to|via|in|at)|(?:on|onto|to|via|in|at)\\s+neither|neither\\s+(?:on|onto|to|via|in|at))(?![${SOCIAL_WORD_EDGE}])`,
'iu',
);
const socialPostNegationGovernsPublish = value => (
diff --git a/src/firefox/src/agent/agent.js b/src/firefox/src/agent/agent.js
index 20b0be80a..43e323bd6 100644
--- a/src/firefox/src/agent/agent.js
+++ b/src/firefox/src/agent/agent.js
@@ -191,7 +191,7 @@ const SOCIAL_POST_NEGATION = new RegExp(
'iu',
);
const SOCIAL_POST_DESTINATION_NEGATION = new RegExp(
- `(?<![${SOCIAL_WORD_EDGE}])not(?![${SOCIAL_WORD_EDGE}])\\s+(?:on|onto|to|via|in|at)(?![${SOCIAL_WORD_EDGE}])`,
+ `(?<![${SOCIAL_WORD_EDGE}])(?:not\\s+(?:on|onto|to|via|in|at)|(?:on|onto|to|via|in|at)\\s+neither|neither\\s+(?:on|onto|to|via|in|at))(?![${SOCIAL_WORD_EDGE}])`,
'iu',
);
const socialPostNegationGovernsPublish = value => (
diff --git a/test/run.js b/test/run.js
index a2319fb9c..2b086044a 100644
--- a/test/run.js
+++ b/test/run.js
@@ -90791,6 +90791,10 @@ test('social publication workflow follows the live X or Bluesky destination and
'explicit affirmative publish clause inherited negation from X'],
['Post this not on X but on Bluesky', ['bluesky'],
'post-verb destination negation selected X instead of contrastive Bluesky'],
+ ['Post on neither X nor Bluesky', [],
+ 'post-verb neither/nor destination scope adopted a forbidden platform'],
+ ['Post neither on X nor on Bluesky', [],
+ 'pre-preposition neither/nor destination scope adopted a forbidden platform'],
['Post on X without posting on Bluesky', ['twitter'],
'a nested negated publish clause added its forbidden Bluesky destination'],
['Post this on Bluesky with no X links', ['bluesky'],