After a busy Claude-assisted development pass, Mediabot v3 received several new improvements around reminders, karma, command helpers, and test automation. The first integration was not clean: a few Perl insertions broke UserCommands.pm, and the bot refused to start.
The good news: the code was recovered, cleaned, and validated by the full static and live test suites.
Mischief managed. The bot is back on its feet, and the tests are green. ✨
This round introduced and refined several user-facing and internal features:
The most visible new behavior is around karma: when karma changes, the bot can compute and display the target’s rank within the channel.
The Claude pass left two real Perl syntax problems in Mediabot/UserCommands.pm.
A missing concatenation operator produced a syntax error around mbRemindList_ctx:
$r->{id_reminder}, $r->{to_nick}$due_t5,
Fixed as:
$r->{id_reminder}, $r->{to_nick} . $due_t5,
The karma rank code had been inserted inside the argument list of botPrivmsg(), which made Perl parse my $rank_str where it expected an expression separator.
The fix was to compute $rank_str before sending the IRC message:
my $rank_str = '';
eval {
my $sth_rank = $self->{dbh}->prepare(
'SELECT COUNT(*)+1 AS rank FROM KARMA WHERE id_channel=? AND score>?'
);
if ($sth_rank && $sth_rank->execute($id_channel, $score)) {
my $rr = $sth_rank->fetchrow_hashref;
$sth_rank->finish;
$rank_str = " (rank #$rr->{rank})" if $rr && defined $rr->{rank};
}
};
Mediabot::Helpers::botPrivmsg(
$self,
$channel,
"$target\'s karma: ${sign}${score}${rank_str}"
);
The full test runner was also improved.
t/full_test.sh now supports:
./t/full_test.sh -d /home/backupwws/mediabot_tests
with a safe fallback to:
/tmp/mediabot_tests
It also supports:
./t/full_test.sh -h
and preserves both static and live test logs while keeping proper exit codes through PIPESTATUS.
This makes long test runs easier to archive, inspect, and compare.
Several live tests were updated to match the current bot behavior instead of older assumptions.
Important fixes included:
!help now correctly expects NOTICE output instead of channel flood;userinfo / whoami output is drained properly;DBD::mysql and DBD::MariaDB.The Partyline restart test now validates the important behavior:
.restart;The schema drift checker had already been made friendlier for Debian 13:
DBD::mysql or DBD::MariaDB;port=3306 with DBD::MariaDB and localhost;SET NAMES utf8mb4 instead of fragile driver-specific charset attributes.This keeps fresh Debian 13 installs practical without forcing a specific Perl DB driver package when MariaDB’s DBI driver is already available.
After the recovery work, all tests passed:
Static tests: green
Live tests: green
The bot also starts successfully again after the UserCommands.pm syntax repairs.
This validates:
Main areas involved in this round:
| File / Area | Purpose |
|---|---|
Mediabot/UserCommands.pm |
reminder and karma fixes, syntax recovery |
t/cases/235_external_claude_persona.t |
Claude persona coverage |
t/cases/236_usercommands_karmahist.t |
karma history coverage |
t/live/*.t |
live test expectations aligned with current behavior |
t/full_test.sh |
full static + live test runner with log directory support |
tools/check_schema_drift.pl |
Debian 13 / MariaDB-friendly schema checks |
This was a messy but valuable round: Claude added useful features, then left a few sharp edges behind. Those edges are now cleaned up.
Mediabot v3 is in a stronger state than before:
Mischief managed. Again. 🪄
You must be logged in to reply.