Forum teuk.org

🧩 Mediabot v3 — The Marauder’s Map Reveals Every Community Footprint

in Mediabot · started by TeuK · 5d ago

TeuK · 5d ago

Commit: c63ff05
Version: 3.4dev-20260818_102721

Mediabot already knew a lot about the people living in its channels.

Messages. Karma. Trivia. Activity streaks. Achievements. Comebacks. Night owls. Long-term history.

With MB665, profile learns one more thing:

how somebody has contributed to the shared memory of the community itself.

🗺️ A wider profile

The existing:

m profil
m profile

already combines several parts of a user’s history into one compact character sheet.

MB665 extends it with a new community footprint:

🧩 community: 📜 28 quotes · 📚 0 factoids

This is deliberately not a new command.

There was no reason to create yet another reporting surface when profile was already the natural home for this information.

📜 Quotes and factoids join the story

The new footprint reuses information Mediabot already persists:

QUOTES
FACTOID

No historical reconstruction is performed.

No new CHANNEL_LOG aggregation was added.

That was an explicit constraint because the enriched profile already has a carefully bounded historical query budget.

Before MB665:

3 CHANNEL_LOG gathers

After MB665:

3 CHANNEL_LOG gathers

Exactly the same.

The community data is retrieved separately through a small read-only helper rather than turning the main profile code into another large aggregation engine.

🧙 The identity problem hiding behind a nickname

Runtime testing uncovered the interesting part of this round.

On IRC, the user appeared as:

Te[u]K

But the corresponding registered Mediabot account was:

teuk

The development database contained:

#radiocapsule
teuk
28 quotes

A naïve implementation using only:

USER.nickname = IRC nickname

therefore returned nothing.

That would have produced a technically valid SQL query — and the wrong answer.

🪄 Reusing the magic from MB646

Mediabot already solved this class of identity problem during the durable Achievement work.

So MB665 does not invent another nickname matching system.

Instead, profile contribution lookup now follows a conservative identity path:

exact registered nickname
        ↓
otherwise
        ↓
existing MB646 durable Achievement identity graph
        ↓
unique registered USER id

The important word is:

unique

If an IRC alias could resolve to more than one registered user, Mediabot refuses to guess.

No identity roulette.

🔎 Real runtime validation

After the identity bridge was corrected, the same real development profile produced:

🧩 community: 📜 28 quotes · 📚 0 factoids

That exactly matched the independent read-only database probe:

#radiocapsule   teuk   28 quotes

So MB665 was validated against both:

database truth
        +
real IRC rendering

rather than only against mocked test data.

🧪 Regression protection

The existing enriched-profile regression was extended and MB665 adds:

t/cases/847_mb665_profile_community_footprint.t

The new coverage checks several important contracts:

registered-user attribution
IRC alias → durable identity resolution
quote attribution
factoid attribution
ambiguous identity refusal
no additional CHANNEL_LOG gather
no random historical scan
compact profile rendering

Focused validation:

PASSED : 36/36
RC=0

The normal fast validation lane also remained completely green:

PASSED : 5187/5187
RC=0
Runtime: 179s

🧱 What MB665 deliberately does not add

no database schema change
no migration
no new configuration
no new public command
no new worker
no new CHANNEL_LOG scan
no service change
no systemd change

That is an important part of the design.

The feature exists because Mediabot can now reuse foundations built during earlier rounds instead of creating another one.

🧠 A small feature with an important lesson

At first glance, counting quotes looks trivial.

The interesting problem was not:

COUNT(*)

It was:

Who does this IRC nickname actually represent?

A profile becomes genuinely useful only when its different subsystems agree about the identity behind it.

MB646 built that durable identity map for Achievements.

MB665 lets another part of Mediabot follow the same map.

The Marauder’s Map already knew who was walking through the castle.

profile just learned how to read it.

You must be logged in to reply.