Help:Ephemera Agent/Instruction Namespace

From Encyclopedia Ephemera
Revision as of 04:29, 1 April 2026 by EphemeraAdmin (talk | contribs) (Import: Help:Ephemera Agent/Instruction Namespace)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Overview

The Instructions: namespace is the control layer of the entire system. It defines how the agent behaves, what pages should look like, how they should be written, and what policies govern canon. Editing an instruction page changes agent behavior immediately — no code changes required.

Page Types

Type Naming Convention Purpose
Core Instructions:Core/PolicyName Global rules applied to every task. Canon policy, continuity rules, voice standards.
Workflow Instructions:Create/TaskType Step-by-step task execution procedures.
Workflow (subtype) Instructions:Create/Source/SubtypeName Type-specific workflow extensions.
Schema Instructions:Schema/PageType Required sections and structure for a page type.
Style Instructions:Style/ToneName Tone, voice, and register guides.
Maintenance Instructions:Maintenance/TaskName Audit and report generation procedures.
Config Instructions:Config Runtime configuration for the context assembly pipeline.
World Bible Instructions:World Bible The canonical universe reference. Always included first in every context package.

Page Structure

Instruction pages store their content as wikitext and their machine-readable metadata as a JSON block inside <nowiki> tags. The JSON is parsed by wiki_api.php to extract the requires dependency list.

Example Page

== Instructions:Create/Source (Base Workflow) ==

Base workflow for creating a new source page and its corresponding Talk page.

=== Scope ===
Applies to all source-generation tasks regardless of document type.

=== Constraints ===
* Source page must be in-universe only
* Talk page must be interpretive
* Do not mix voices
* Maintain canon continuity

=== Procedure ===
# Determine source type
# Identify metadata
# Infer bias and reliability
# Write in-universe content
# Create source page
# Create Talk page
# Populate analysis

<pre><nowiki>
{
  "meta": {
    "id": "create-source-base",
    "type": "workflow",
    "applies_to": "Sources",
    "task_type": "create",
    "priority": "high",
    "status": "active",
    "canonical": true,
    "requires": [
      "Instructions:World Bible",
      "Instructions:Schema/Source Page",
      "Instructions:Core/Continuity Rules"
    ],
    "tags": ["source", "create", "base"]
  }
}
</nowiki></pre>

The requires Field

The requires array in the JSON metadata is the dependency graph. When the context pipeline selects an instruction page, it also fetches all pages listed in requires, and their requirements, up to max_depth hops.

Rules:

  • List only direct dependencies — transitive ones are resolved automatically
  • Use full page titles: "Instructions:Core/Canon Policy"
  • Circular dependencies are safe — the BFS traversal tracks visited nodes
  • Keep dependency chains shallow — deep chains consume token budget

The World Bible

Instructions:World Bible is the most important page in the system. It is always loaded first, before any other instruction page, for every context assembly call. It should contain:

  • The fundamental premise of the universe (year, setting, tone)
  • Core factions, polities, and power structures
  • Canonical technology level and constraints
  • Voice and register standards that apply everywhere
  • Any facts that must never be contradicted

Keep it concise — it consumes token budget on every call.

Instructions:Config

See Help:Ephemera Agent/Configuration#Instructions:Config for the full reference. The config page controls context assembly parameters and can extend the task type list without PHP changes.

Bulk Loading the Instruction Namespace

The fastest way to populate the Instructions: namespace is via the Bulk Import tool. Prepare your instruction pages in the instruction namespace JSON schema format and import them in one operation with no AI calls required.