refactor: extract AiText and detect foreign-script leakage

Moves sanitise out of the Bukkit-bound Ai class so it can be unit
tested, and adds hasForeignScript to catch the CJK words the model
intermittently drops into Portuguese answers.

Colour-code stripping now removes the code character too: replacing
only the section sign left "§c" reading as a stray "c" in chat.

Surefire now fails on an empty suite, so a misplaced or disabled test
class cannot pass as a green build.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F3jSvSTrG4qsniLSr6TpC6
This commit is contained in:
marcos
2026-08-05 15:03:00 +00:00
parent be1f31778a
commit 4f427659bb
4 changed files with 116 additions and 38 deletions
+7
View File
@@ -68,6 +68,13 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.4</version>
<configuration>
<!-- The pin above guards against a surefire version that quietly stops
discovering tests. It does not guard against a test class being
misplaced, misnamed or disabled, which ends the same way: a green
build that ran nothing. Failing on an empty suite closes that gap. -->
<failIfNoTests>true</failIfNoTests>
</configuration>
</plugin>
</plugins>
</build>