Forum teuk.org

🪄 Accio Better Answers, Protego the Runtime! Mediabot MB838–MB854

in Mediabot · started by TeuK · 3d ago

TeuK · 3d ago

18–19 October 2026 · Channel-controlled MetaAI, sensible sources, confirmed X authentication, fuller DTC stories and seventeen rounds of maintenance.

The previous chapter ended with MB837: clearer source labels, stronger runtime ownership and a logbook that could survive a failed reopen. Since then, the maintenance quill has travelled through seventeen more rounds, from MB838 to MB854.

Some changes are immediately visible on IRC. MetaAI can now be enabled with a channel flag. Simple calculations and greetings no longer need a research expedition. DTC quotes have enough room to tell their story. Other changes work behind the scenes, making sure retired callbacks stay retired, failed launches release their capacity and Unicode names keep their history.

The latest complete validation on teuk.org passed 26,092 tests across 1,136 files. Throughout these rounds, the database schema stayed unchanged: no new tables, columns or indexes. MetaAI registration uses data in the existing channel-setting tables. 🛡️

🏰 MetaAI gets its own channel ward — MB842

Enabling collective AI conversation should be an ordinary channel-management action. It now is:

!chanset #i/o +MetaAI
!chanset #i/o -MetaAI

Once the MetaAI setting is registered, addressed questions such as mediabot: question use this native flag. They no longer depend on maintaining a channel allowlist in the private configuration or borrowing the legacy +chatGPT flag.

The existing permissions remain authoritative. Authenticated Administrator, Master and Owner identities retain global access; an authenticated channel user needs level 450 or higher on the target channel. A failed database write produces a failure response rather than a cheerful but false success message.

Channel policy is checked when a question arrives and again before delayed delivery. Removing +MetaAI revokes pending output. Even a rapid disable/re-enable cannot revive the old answer. A disabled MetaAI channel does not silently hand addressed questions to the legacy single-provider chatbot; explicit legacy commands retain their own policy.

An optional global ENABLED=0 remains available as an emergency stop. Provider keys, models, budgets and web settings still belong in private configuration. Channel activation belongs with channel administration.

A careful handover, not an activation avalanche

The migration tool previews eligible legacy pilot channels before any write. Explicit adoption registers the setting and preserves only channels already eligible for the previous collective route, in one transaction. Running initialization again cannot restore a flag an operator later removed.

That handover was applied to all six instances. Existing eligible pilots were retained; ubot, WitchHunter and Libera adopted no channels, leaving their channel opt-in empty until an operator chooses otherwise. No conversation-history reset or schema alteration was needed.

Six instances, one scoped inspection

Ansible was also brought into the operations workflow, using the existing ansible account on teuk.org. The audit and repair were restricted to the six intended bots: the development and Undernet instances on teuk.org, Epiknet on nbot, ubot, WitchHunter and Libera.

The checks tied each configuration to its owner, working directory and systemd service. Missing provider/search/shortener settings were filled privately, ubot’s configuration permissions were corrected, and four dedicated ShortURL credentials were prepared. Existing credentials and models were preserved; secret values stayed out of the displayed reports.

The process check was corrected to identify the service’s systemd MainPID, allowing legitimate descendant workers without mistaking them for duplicate bot instances. Repairs then completed on the four instances that needed changes; the development and Epiknet configurations required no restart.

These results establish configuration and process readiness. They do not, by themselves, certify every provider account, billing state or live HTTPS redirect. Live acceptance remains a separate check.

📚 The library opens when the question needs it — MB843

A hypothetical arithmetic puzzle does not need a Reddit citation. A greeting in German does not need two websites explaining what a greeting is.

MB843 adjusts automatic research so that self-contained calculations, ordinary translations, supplied-text transformations and greetings can stay local to the existing AI conversation flow:

mediabot: if I lose 10 kg and regain 5 kg each cycle, when do I cross my target?
mediabot: wie geht's?

Those tasks should receive an answer without an unnecessary source line or shortener request. Calculation instructions also distinguish a complete cycle, an intermediate value, an exact target and crossing a threshold.

Research remains the default for external factual questions, including timeless reference questions. Explicit requests for sources, current facts, technical verification and medical, legal or financial advice retain the research route. Translating supplied text containing words such as “latest sources” does not turn those words into public search instructions.

Known self-contained patterns can avoid research directly. For unfamiliar wording, the existing contributor responses carry a task classification; local routing requires agreement from enough usable contributors, with at least two. Missing classifications, disagreement or a factual task retain research. This adds no separate classification API call.

The distinction is still heuristic. Avoiding unnecessary search reduces extra work; it does not promise perfect intent recognition, correct arithmetic from every model or a fixed response time.

When research is appropriate, the labelled sources introduced in the previous article remain: dark-grey site names, compact short links and paced delivery. When it is unnecessary, the source line stays out of the conversation.

Accio evidence when needed. Let a greeting remain a greeting. 🦉

🔐 X authentication earns its confirmation — MB838

Undernet-compatible authentication now shares one controller for startup, manual requests and periodic recovery:

!xauth
!xauth status
!xlogin
!xlogin status

These commands require authenticated Master or Owner access and use credentials already stored in the private configuration. Account and password arguments are not accepted on IRC.

Sending LOGIN is no longer confused with being authenticated. Mediabot verifies the actual connected nickname through a complete server WHOIS response and checks the configured account. When +x is positively requested in configuration, it requests host hiding after account confirmation and verifies the resulting user modes. Configured Undernet autojoins wait for those required confirmations.

The default verification interval is five minutes. A complete negative account result can trigger automatic authentication; an incomplete reply or timeout remains unverified and does not automatically send a password. A different authenticated account is reported as a mismatch rather than being switched automatically.

Checks and retries are bounded, with at least five minutes between LOGIN attempts. Healthy checks do not repeat the initial joins. Disconnects and nickname changes invalidate obsolete state, and X notice text alone cannot grant authentication.

This remains post-registration authentication, not a promise that the real host was never visible before login. The existing Libera authentication flow remains separate.

📖 DTC gets room for the punchline — MB849

The old automatic DTC budget could leave just one dialogue line, followed by ... and a link. That was a very short visit to the Restricted Section.

Automatic Spark delivery now shares the manual formatter’s ten-line quote budget:

  • Quotes of up to ten lines appear in full.
  • Longer quotes show eight dialogue lines, then ... and the canonical quote link.

This applies to automatic stories and manual !dtc / !bashfr requests, including random selection, a specific quote number and searches. Spark still displays the command before its automatic story.

Existing AntiFlood handling, source permissions, cooldowns, anti-repeat rules and IRC byte limits remain in place. A fuller excerpt is not permission to flood the common room. ⚡

⏳ Delayed work keeps its rightful owner — MB839–MB848

A recurring theme in these reviews was ownership: a callback belongs to one request, one connection or one task lifetime. Completing late must not give it authority over whatever replaced it.

  • MB839 — Calendar and Hailo completion. Calendar scheduling rechecks task identity after the next-date resolver runs. A resolver that stops, restarts or replaces its task cannot publish an obsolete timer. Hailo post-editing claims one terminal decision, preserving an already completed edit if the launcher subsequently throws and refusing duplicate fallback delivery.
  • MB840 — Asynchronous command context. Replies and auxiliary notices stay bound to their original IRC transport and supplied channel lifetime. Reconnects, part/rejoin, shutdown or replacement state can revoke obsolete output. Timeout cleanup releases streams and timers, completes after the existing termination grace when EOF is missing, and does not signal an already reaped process number.
  • MB841 — DTC and plugin HTTP launches. Source slots are reserved before launch and released before notifying consumers. Inline completion, refusal, exceptions and duplicate callbacks cannot resurrect an old handle or consume a successor’s slot. Disabling a plugin during HTTP launch retains revocation and cancels the returned handle.
  • MB844 — RSS recovery and IRC identities. Failed or synchronously completed RSS launches release their capacity and channel barriers. Conversation lifecycle checks now follow the server’s negotiated channel-name rules, so equivalent PART/KICK spellings revoke delayed replies without merging channels that the network treats as distinct.
  • MB845 — RandomQuote and plugin events. Each automatic quote attempt completes once and frees its reservation. Clearing a plugin event queue ends the old batch; events accepted after that belong to a fresh generation, including disable/re-enable during a handler.
  • MB846 — Paced MetaAI answers. Each scheduled line has one consumable arm. Retained callbacks cannot send sources early, commit memory twice or clear the next question’s reservation. Scheduling failure releases capacity without bursting the remaining lines or storing a partial reply as a completed exchange. The final R2 correction also releases completed runtimes under Perl 5.40.
  • MB848 — VDM completion and recovery. Completed fetches detach their workers and waiting consumers before notification. Manual and Spark launch failures free the channel for a later request, while late callbacks cannot contradict a completed result or interfere with its successor.

These corrections retain the existing final permission checks, concurrency bounds, cancellation rules and pacing. They address reproduced failure paths; they are not claims that every such sequence occurred in production.

🕰️ Repair the Time-Turners — MB852 and MB853

Timer setup can fail after a native timer has already been attached or started. Cleaning up only the bookkeeping leaves something capable of firing behind it.

MB852 makes shared worker timer setup revoke its callback and stop/remove the provisional timer when registration or start fails. A retained failed callback cannot keep the request context alive or call a consumer later.

Termination also remains effective if its grace timer cannot be armed: the still-owned child is escalated immediately when necessary. A failed finalization backstop can finish without relying on another timer. The existing process watcher keeps reaping ownership, and a process number already reaped is not signalled again. Ordinary deadlines, grace periods and output limits retain their existing values.

MB853 applies the same care to periodic scheduler registration and start. Failed construction or attachment removes only the original task and its provisional timer. A same-name replacement created during reentry survives. A timer that partially starts before throwing is stopped, leaving a manual registration available for an explicit retry.

The regressions exercise real timers, loop delivery and fork/pipe completion. The clock is tested by making it tick, then making its failure paths answer for themselves. ⏳

🧠 Unicode keeps its memories — MB850 and MB851

Unicode should not make an RSS identity, a plugin error or a Hailo nickname impossible to hash.

MB850 handles wide Unicode RSS IDs, GUIDs, URLs and fallback title/date identities. Previously valid keys keep their exact identity, preserving announced history rather than treating old articles as newly discovered. Plugin failure fingerprints receive the same protection while retaining bounded reports, failure counts and exception redaction.

MB851 extends that continuity to Hailo’s network/channel brain identities and neutral nickname buckets. Existing brain paths and learned mappings remain valid; wide Unicode names no longer abort selection, normalization or nickname restoration. Save, eviction and reopening are covered without resetting or rewriting brains.

The associated source security check was updated for the explicit byte preparation, with regressions proving that missing isolation or privacy boundaries still fail the audit.

The Pensieve learns to read the name without losing the memory. 🌀

📻 Clear radio text and finite measurements — MB847

Radio JSON now preserves UTF-8 bytes already produced by its encoder instead of encoding them a second time. International artist names, titles and nested metadata arrive intact, and HTTP Content-Length matches the bytes actually transmitted.

Metrics reject nonnumeric, reference and non-finite samples, including values that overflow during conversion or addition. Invalid updates leave the previous valid measurement intact. Scalar operations cannot corrupt histograms, while legitimate finite values, existing histogram buckets and the terminal +Inf bucket remain supported.

Endpoints, instrumentation names and the existing metrics cache policy remain unchanged.

🕯️ Keep the logbook alive through rotation — MB854

The previous article described MB837’s safer reopen: prepare the replacement before closing the active descriptor. MB854 follows that protection through automatic rotation.

Archive moves are now checked. If an older archive cannot be moved, rotation stops before promoting the base file over the archive it failed to preserve. If automatic rotation or reopening fails, the current record still gets its normal write attempt on the active descriptor and its Partyline console delivery.

A fixed diagnostic is emitted once per failed rotation streak, without including a path, exception or message text. A successful rotation resets that suppression. Explicit initial-open and manual-reopen errors remain explicit.

Rotation is still a series of filesystem renames, not an atomic transaction across every archive. Earlier successful moves remain if a later move fails, and a full or unwritable filesystem cannot be made writable by the logger. The correction preserves the usable path forward without inventing a successful rotation.

🧪 The O.W.L. scorecard

Every round below passed its complete suite on teuk.org. These are successive checkpoints, not totals to add together.

Round Main change Complete suite
MB838 Confirmed X authentication and recovery 24,290 / 24,290
MB839 Calendar and Hailo completion ownership 24,380 / 24,380
MB840 Async reply context and cleanup 24,459 / 24,459
MB841 DTC and plugin HTTP launch recovery 24,564 / 24,564
MB842 Native MetaAI channel activation 24,669 / 24,669
MB843 Research and source selection 24,886 / 24,886
MB844 RSS lifecycle and negotiated channel identity 25,012 / 25,012
MB845 Quote attempts and event generations 25,128 / 25,128
MB846 R2 MetaAI pacing and delivery recovery 25,258 / 25,258
MB847 Numeric metrics and radio UTF-8 25,437 / 25,437
MB848 VDM completion and launch recovery 25,592 / 25,592
MB849 Fuller automatic and manual DTC display 25,673 / 25,673
MB850 Unicode RSS and plugin diagnostics 25,772 / 25,772
MB851 Unicode Hailo identities 25,874 / 25,874
MB852 Shared worker timer recovery 25,985 / 25,985
MB853 Periodic scheduler recovery 26,037 / 26,037
MB854 Log rotation continuity 26,092 / 26,092

Compared with MB837’s 24,047 tests across 1,101 files, the suite has grown by 2,045 assertions and 35 files. The latest round also passed 1,855 focused tests, 8,316 fast-lane tests and all 37 source security invariants. The fast lane remains a development check; it does not replace the full suite.

The source packages retain isolated previews, private source backups and restoration after a failed required check. Installation does not stage, commit or restart bots. The Ansible configuration repair was a separate, explicitly applied operation with private backups and only the necessary instance restarts.

At this checkpoint, MB854 has passed host validation and its source is prepared. Development IRC acceptance, its commit through commit.sh and subsequent production rollout are the next steps; the validation result does not claim that every production instance already runs MB854. Mediabot remains on the 3.6dev development line.

Accio useful answers. Reparo the clocks. Protego the logbook. 📖🪄

You must be logged in to reply.