Forum teuk.org

MB759 — The Quiet Librarian Takes the Factoid Shelves 📚🕯️

in Mediabot · started by TeuK · 10h ago

TeuK · 10h ago

The Restricted Section has gained a new custodian.

With commit b91b2bb, Mediabot now ships the inert factoids-v3 package: a deliberately narrow API v3 home for the public, side-effect-free factoid and factoids commands. The old portraits have not been torn from the walls; they remain in place, ready to resume their duties whenever policy is switched off or the plugin is unloaded. 🖼️🗝️

A Small Spell with a Strict Boundary

The new package receives only two capabilities:

  • data.factoids.read
  • irc.notice

That is the whole permission parchment. The plugin receives no SQL or DBI handle, no mutable user object, no credentials, no raw IRC message, no cross-channel selector, and no factoid-writing authority.

Only two commands cross the API v3 threshold:

  • factoid, for one exact factoid and its metadata;
  • factoids, for bounded lists, filtered lists, and the most-recalled view.

The mutating and recall-sensitive paths remain with the historical implementation. whatis, learn, forget, the ?keyword shortcut, and recall-counter writes have not moved. MB759 therefore advances the platform without quietly widening its authority.

The Reversible Portrait Passage 🪄

The migration follows Mediabot’s saved-handler bridge:

  • With policy off, the original handlers remain authoritative.
  • In observe, API v3 performs its bounded reads silently while the historical handler remains the only visible answer.
  • With policy on, factoids-v3 becomes authoritative only on the explicitly selected channel.
  • Disabling or unloading the package restores the exact command-registry entries captured when it was loaded.

Installing the source does not load the plugin, grant permissions, enable it, or opt any channel in. The package remains inert until an operator deliberately opens the door.

A Supervised Visit to #test 🔭

The live pilot loaded factoids-v3, granted its exact two capabilities, and placed #test in observe. The v3 path stayed silent as required, while the historical path respected the channel’s existing Factoids setting.

The policy was then promoted temporarily to on. Four public paths were exercised:

  • an exact lookup for a deliberately missing keyword;
  • a filtered list with no match;
  • the normal factoid list;
  • the top-recall view.

Each produced the expected bounded notice. A complete before-and-after snapshot confirmed that every factoid row—including recall counters—was unchanged. The plugin reported no failures.

Finally, policy moved to off, the package was disabled and unloaded, and the saved historical handlers returned to their exact registry positions. No plugin registration, policy, temporary Partyline account, or data mutation remained behind. The librarian left the desk exactly as it was found. 🧹✨

Proof from the Great Hall

The validation gates all passed:

  • targeted API v3 and factoid suite: 1,011 / 1,011;
  • fast development lane: 7,673 / 7,673;
  • final full suite: 20,230 / 20,230 across 999 test files;
  • supervised Partyline and IRC pilot: PASS;
  • rollback and factoid immutability checks: PASS.

The service remained active after the commit and push.

What MB759 Changes—and What It Does Not

MB759 turns the MB758 read service into a real, reversible command adoption while keeping the blast radius intentionally small. It proves that legacy public readers can pass through API v3 policy, capability, observability, and rollback controls without granting the plugin direct database access or changing user data.

It does not migrate factoid writes. It does not alter the schema. It does not enable the package anywhere by default. It does not increment recall counters during v3 reads.

The result is less a dramatic duel than a careful piece of Ministry work: two reading spells, one tightly sealed permission scroll, and a reliable route back through the portrait should the castle ever need it. 📜🏰


Commit: b91b2bbMB759: appoint a quiet librarian to the factoid shelves 📚🕯️

You must be logged in to reply.