Forum teuk.org

πŸ† MB668 β€” The Room of Requirement Rewards the Keepers of Memory

in Mediabot Β· started by TeuK Β· 4d ago

TeuK Β· 4d ago

Feature commit: f291373
Certification fix: 6581f38
Current version: 3.4dev-20260819_081107

Mediabot already remembers who talks, who returns, who stays active and who shapes the rhythm of a channel.

With MB668, it also starts rewarding the people who actively build the channel’s shared memory.

πŸͺ„ Five new Community Achievements

πŸ“œ Archivist          β€” 10 quotes
πŸ—„οΈ Master Archivist  β€” 50 quotes
πŸ“š Lorekeeper         β€” 10 factoids
🧠 Encyclopedist      β€” 50 factoids
🧩 Curator            β€” 10 quotes + 10 factoids

These are derived from real stored content rather than blind increment-only counters.

πŸ“š QUOTES and FACTOID remain the source of truth

After a successful quote or factoid write, Mediabot rereads the user’s actual contribution totals from the existing database state.

Achievement progress is then synchronized from those real totals.

This keeps progression naturally safe against retries and factoid UPSERTs:

retry          β†’ no artificial extra progress
factoid UPSERT β†’ no duplicate merit
repeated write β†’ progress still reflects stored content

No second competing persistence model was introduced.

πŸ§™ Durable identity still applies

Community contributions flow through Mediabot’s durable Achievement identity layer.

A transient IRC nick such as:

Te[u]K

can still resolve to the persistent registered identity:

teuk

so contribution history stays attached to the same profile.

πŸ† Runtime unlock

The first development runtime validation on #radiocapsule immediately exercised the complete path:

πŸ† Achievement Unlocked! Te[u]K β†’ πŸ“œ Archivist (uncommon)

That confirmed:

quote write
β†’ contribution recount
β†’ durable identity resolution
β†’ Achievement progress
β†’ unlock
β†’ IRC notification

πŸ› The Achievement that stole a quote ID

That same runtime test exposed a real bug.

The first quote was reported as:

done. (id: 735723)

but deleting that ID failed.

A read-only probe found the actual quote:

id=55

The reason was precise:

INSERT INTO QUOTES
β†’ Achievement synchronization performs other INSERTs
β†’ last_insert_id()

By the time the quote code read last_insert_id(), the Achievement layer had already changed the connection’s latest INSERT id.

πŸ”§ Correct ordering

The quote id is now captured immediately:

INSERT INTO QUOTES
β†’ capture quote last_insert_id()
β†’ Achievement synchronization

The follow-up runtime test proved the repair:

(teuk) done. (id: 56)
(teuk) deleted. (id: 56)

A regression guard now protects that ordering.

πŸ§ͺ Focused and fast validation

Focused MB668 regression:

PASSED : 213/213
RC=0

Fast validation lane:

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

πŸ” Full-suite checkpoint found one stale MB659 test

A complete suite was then run and produced:

FAILED : 1/13837

The failure was not an MB668 runtime regression.

841_mb659_enriched_profile.t still expected the old visible Achievement denominator:

expected: 10/32
actual:   10/37

MB668 added exactly five new visible achievements.

The test also used real-looking fixtures:

Balibalo
#radiocapsule

Those fixtures were replaced by synthetic values, and the test no longer hard-codes the catalogue size.

It now derives the visible Achievement total from the registry itself, so another legitimate catalogue addition will not create the same artificial failure.

Focused validation of the corrected test set:

PASSED : 154/154
RC=0

βœ… Final certification

After that correction, the complete Mediabot suite passed:

PASSED : 13837/13837
RC=0
Runtime: 955s

This establishes the final MB668 checkpoint.

The ~16-minute full-suite runtime remains an explicit engineering debt to address later without weakening coverage.

🧱 Operational impact

MB668 introduces:

no database schema change
no migration
no new configuration key
no new persistence layer

The post-commit certification fix changes only:

CHANGELOG.md
VERSION
t/cases/841_mb659_enriched_profile.t

No application runtime code was changed by that follow-up commit.

✨ Commits

Feature:

f291373
πŸ† Let the Room of Requirement Reward Its Keepers of Memory

Final certification fix:

6581f38
πŸ§ͺ Teach the Pensieve to Count Every New Achievement

Current version:

3.4dev-20260819_081107

πŸ—ΊοΈ The social-memory arc

MB664 β†’ Channel Memory
MB665 β†’ Community Footprint
MB666 β†’ Channel Awards
MB667 β†’ Channel Yearbook
MB668 β†’ Community Achievements

Mediabot is gradually moving from merely storing channel history to understanding how people contribute to that history.

Some people fill the shelves.

Some preserve the stories.

Some become the reason the Room of Requirement has something worth finding. πŸ†πŸ“šβœ¨

You must be logged in to reply.