Harden soft Scattermind guardrails

This commit is contained in:
OpenClaw Bot
2026-05-27 17:08:37 +02:00
parent 759c1b2fe4
commit c3edf9f29d
3 changed files with 31 additions and 2 deletions
+3 -1
View File
@@ -182,7 +182,9 @@ function guardrailsFromContextText(value = '') {
const cleaned = cleanText(sentence, 180);
if (!cleaned) continue;
if (/^(avoid|no|do not|don't|dont|must not|never|non-goal|non goal|not yet|out of scope)\b/i.test(cleaned)) nonGoals.push(cleaned.replace(/^non[- ]goal\s*:\s*/i, ''));
else if (/\b(avoid|no auth|no account|no billing|no workspace|not a dashboard|without accounts|before proof|manual proof|solo builder|constraint)\b/i.test(cleaned)) constraints.push(cleaned);
else if (/\b(keep|leave|hold)\b[^.!?]{0,80}\b(out|later|until proof|after proof|not yet)\b/i.test(cleaned)) nonGoals.push(cleaned);
else if (/\b(not a dashboard|not another dashboard|no dashboard swamp|dashboard swamp)\b/i.test(cleaned)) nonGoals.push(cleaned);
else if (/\b(avoid|no auth|no account|no billing|no workspace|without accounts|before proof|manual proof|solo builder|constraint)\b/i.test(cleaned)) constraints.push(cleaned);
}
return { nonGoals: uniqueList(nonGoals), constraints: uniqueList(constraints) };
}