<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://ephemerawiki.space/index.php?action=history&amp;feed=atom&amp;title=Help%3AEphemera_Agent%2FMaintenance_Tools</id>
	<title>Help:Ephemera Agent/Maintenance Tools - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://ephemerawiki.space/index.php?action=history&amp;feed=atom&amp;title=Help%3AEphemera_Agent%2FMaintenance_Tools"/>
	<link rel="alternate" type="text/html" href="https://ephemerawiki.space/index.php?title=Help:Ephemera_Agent/Maintenance_Tools&amp;action=history"/>
	<updated>2026-05-19T11:02:03Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.3</generator>
	<entry>
		<id>https://ephemerawiki.space/index.php?title=Help:Ephemera_Agent/Maintenance_Tools&amp;diff=699&amp;oldid=prev</id>
		<title>EphemeraAdmin: Add Maintenance Tools documentation (implemented 2026-04-22)</title>
		<link rel="alternate" type="text/html" href="https://ephemerawiki.space/index.php?title=Help:Ephemera_Agent/Maintenance_Tools&amp;diff=699&amp;oldid=prev"/>
		<updated>2026-04-23T02:41:00Z</updated>

		<summary type="html">&lt;p&gt;Add Maintenance Tools documentation (implemented 2026-04-22)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{DISPLAYTITLE:Ephemera Agent — Maintenance Tools}}&lt;br /&gt;
__TOC__&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Wiki Control Panel&amp;#039;&amp;#039;&amp;#039; (MAINT tab in the agent UI) provides deterministic, read-only maintenance queries against the wiki. No LLM is involved. Results are returned instantly and are clickable — clicking a page title opens it in the Browser tab.&lt;br /&gt;
&lt;br /&gt;
== Accessing the Control Panel ==&lt;br /&gt;
&lt;br /&gt;
Click the &amp;#039;&amp;#039;&amp;#039;MAINT&amp;#039;&amp;#039;&amp;#039; button in the top header bar of the agent UI.&lt;br /&gt;
&lt;br /&gt;
== Backend: maintenance.php ==&lt;br /&gt;
&lt;br /&gt;
All tools call &amp;lt;code&amp;gt;maintenance.php&amp;lt;/code&amp;gt; directly via POST with an &amp;lt;code&amp;gt;action&amp;lt;/code&amp;gt; parameter. The file uses bot credentials (from &amp;lt;code&amp;gt;/etc/environment&amp;lt;/code&amp;gt;) via the shared &amp;lt;code&amp;gt;wiki_api.php&amp;lt;/code&amp;gt; layer. It is read-only — no writes of any kind.&lt;br /&gt;
&lt;br /&gt;
== Available Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Stub Pages ===&lt;br /&gt;
&lt;br /&gt;
; Action: &amp;lt;code&amp;gt;stubs&amp;lt;/code&amp;gt;&lt;br /&gt;
; Namespace: Encyclopedia (NS 0)&lt;br /&gt;
; Method: MediaWiki search — &amp;lt;code&amp;gt;hastemplate:stub&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns pages in the main namespace that use the &amp;lt;code&amp;gt;{{stub}}&amp;lt;/code&amp;gt; template. These are candidates for the Expand workflow.&lt;br /&gt;
&lt;br /&gt;
=== Orphaned Pages ===&lt;br /&gt;
&lt;br /&gt;
; Action: &amp;lt;code&amp;gt;orphans&amp;lt;/code&amp;gt;&lt;br /&gt;
; Namespace: All&lt;br /&gt;
; Method: MediaWiki built-in special page — &amp;lt;code&amp;gt;LonelyPages&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns pages with no inbound links from any other page. Orphaned pages are invisible to navigation and to the agent&amp;#039;s link-expansion context step.&lt;br /&gt;
&lt;br /&gt;
=== Uncategorized Pages ===&lt;br /&gt;
&lt;br /&gt;
; Action: &amp;lt;code&amp;gt;uncategorized&amp;lt;/code&amp;gt;&lt;br /&gt;
; Namespace: Encyclopedia (NS 0)&lt;br /&gt;
; Method: MediaWiki built-in special page — &amp;lt;code&amp;gt;UncategorizedPages&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns NS 0 pages belonging to no category.&lt;br /&gt;
&lt;br /&gt;
=== Missing References ===&lt;br /&gt;
&lt;br /&gt;
; Action: &amp;lt;code&amp;gt;missing_references&amp;lt;/code&amp;gt;&lt;br /&gt;
; Namespace: Encyclopedia (NS 0)&lt;br /&gt;
; Method: Batch content fetch + string check&lt;br /&gt;
&lt;br /&gt;
Returns pages ≥ 500 characters that have no &amp;lt;code&amp;gt;== References ==&amp;lt;/code&amp;gt; section. Very short pages (likely stubs) are skipped.&lt;br /&gt;
&lt;br /&gt;
=== Missing {{Instruction}} Template ===&lt;br /&gt;
&lt;br /&gt;
; Action: &amp;lt;code&amp;gt;missing_instruction&amp;lt;/code&amp;gt;&lt;br /&gt;
; Namespace: Instructions (NS 100)&lt;br /&gt;
; Method: allpages list + batch template property check&lt;br /&gt;
&lt;br /&gt;
Returns Instruction namespace pages that do not use the &amp;lt;code&amp;gt;{{Instruction}}&amp;lt;/code&amp;gt; template. These pages will not have structured metadata and may be invisible to the context assembly pipeline.&lt;br /&gt;
&lt;br /&gt;
=== Missing {{Source}} Template ===&lt;br /&gt;
&lt;br /&gt;
; Action: &amp;lt;code&amp;gt;missing_source&amp;lt;/code&amp;gt;&lt;br /&gt;
; Namespace: Sources (NS 102)&lt;br /&gt;
; Method: allpages list + batch template property check&lt;br /&gt;
&lt;br /&gt;
Returns Source namespace pages that do not use the &amp;lt;code&amp;gt;{{Source}}&amp;lt;/code&amp;gt; template. These pages lack reliability, bias, and canon_status metadata.&lt;br /&gt;
&lt;br /&gt;
== API Reference ==&lt;br /&gt;
&lt;br /&gt;
Direct POST to &amp;lt;code&amp;gt;https://ephemerawiki.space/maintenance.php&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;action&amp;quot;: &amp;quot;stubs&amp;quot;,   // or orphans, uncategorized, missing_references,&lt;br /&gt;
                        //    missing_instruction, missing_source&lt;br /&gt;
   &amp;quot;limit&amp;quot;: 100         // max results, default 50, max 200&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Response:&lt;br /&gt;
&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;action&amp;quot;: &amp;quot;stubs&amp;quot;,&lt;br /&gt;
   &amp;quot;pages&amp;quot;: [&lt;br /&gt;
     { &amp;quot;title&amp;quot;: &amp;quot;Example Page&amp;quot;, &amp;quot;size&amp;quot;: 842, &amp;quot;timestamp&amp;quot;: &amp;quot;2026-04-22T...&amp;quot; }&lt;br /&gt;
   ],&lt;br /&gt;
   &amp;quot;count&amp;quot;: 1,&lt;br /&gt;
   &amp;quot;total_checked&amp;quot;: 47   // present on template/reference checks only&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Planned Extensions ==&lt;br /&gt;
&lt;br /&gt;
The following are defined in the maintenance proposal but not yet implemented:&lt;br /&gt;
&lt;br /&gt;
* Category B — Preview/report tools (generate proposed change plans, no writes)&lt;br /&gt;
* Category C — Guarded write tools (dry-run + confirmation step)&lt;br /&gt;
* LLM-assisted editorial workflows via &amp;lt;code&amp;gt;Instructions:Maintenance/*&amp;lt;/code&amp;gt; pages&lt;br /&gt;
* Scheduled maintenance runs&lt;br /&gt;
&lt;br /&gt;
[[Category:Help]]&lt;br /&gt;
[[Category:EphemeraAgent]]&lt;/div&gt;</summary>
		<author><name>EphemeraAdmin</name></author>
	</entry>
</feed>