King Klown Logo
King Klown& KOA

Orchestration Slice-by-Slice Prompt Hydration

Architectural Lineage (Credits):
SwarmCraft is an architectural fork and deep rewrite of the multi-agent swarm engine created by Mojomast in mojomast/swarmussy.
SwarmCraft’s deterministic “Architect-style” layering is also derived from the meta-structure of Abstract Wiki Architect (AWA).
Full details: Credits & Lineage

POWERED BY GROK

SwarmCraft avoids “prompt sprawl” by hydrating prompts with only the active slice of the story.

Slice-by-slice prompt hydration means:

This is the core mechanism that prevents scaffold repetition from becoming prose repetition.


1) Inputs to Prompt Hydration

Hydration assembles a prompt from four categories:

  1. Part slice (required)

    • the target Part’s thread beats (grid cells)
    • the target Part’s contract (goal/obstacle/turn/outcome)
  2. Local continuity (required, minimal)

    • previous Part outcome (or last approved summary)
    • chapter summary / chapter objective (if available)
    • any hard constraints that apply to this moment (POV/tense/reading level)
  3. Global references (optional, clipped)

    • character snippets relevant to the scene
    • location/lore snippets relevant to the scene
  4. Memory retrieval (optional, bounded)

    • top-k RAG snippets relevant to this Part’s contract/beat queries

Related sources:


2) The Hydration Contract (Normative)

The orchestrator MUST obey these constraints:

2.1 One Part only

Hydration MUST be for exactly one part_id at a time.

2.2 Minimalism

Hydration MUST:

2.3 Bounded memory

If RAG is enabled:

2.4 Locks respected

If outline.parts[part_id].locks.manuscript == true:

Matrix locking semantics: Central Matrix


SwarmCraft prompts are assembled in stable sections so they are debuggable and repeatable.

Recommended high-level sections:

  1. System / Persona role
  2. Task definition
  3. Part contract
  4. Part beats (thread grid cells)
  5. Local continuity summary
  6. Relevant Story Bible excerpts (clipped)
  7. RAG memory evidence (clipped)
  8. Output format requirements

This is the structured payload the orchestrator can assemble before rendering a text prompt:

{
  "target": {
    "chapter_id": "CH01",
    "part_id": "P001",
    "action": "DRAFT"
  },
  "contract": {
    "goal": "...",
    "obstacle": "...",
    "turn": "...",
    "outcome": "..."
  },
  "beats": {
    "Plot": "...",
    "Character Development": "...",
    "Conflict": "...",
    "Themes": "...",
    "World-Building": "...",
    "Emotion": "...",
    "Symbolism and Imagery": "...",
    "Structure": "...",
    "Relationships": "..."
  },
  "continuity": {
    "previous_part_outcome": "N/A (first part)",
    "chapter_summary": "Global crisis exposes systemic failure.",
    "must_preserve": [
      "POV: third limited",
      "Tense: past",
      "Tone: clear, cinematic"
    ]
  },
  "references": {
    "characters": [
      {"id": "king_klown", "snippet": "Core traits, current arc state..."}
    ],
    "locations": [],
    "lore": []
  },
  "rag_evidence": [
    {"source": "P000.md", "snippet": "Earlier mention of ..."},
    {"source": "king_klown.md", "snippet": "Established constraint ..."}
  ],
  "output": {
    "format": "markdown",
    "length_target_words": 900,
    "must_hit_contract": true
  }
}

The persona sees a rendered version of this payload, not the entire project.


5) How the Slice Prevents Repetition

Scaffold repetition is acceptable because it is planning data. Prose repetition is not.

Hydration prevents repetition by ensuring:


6) Editor Hydration (Review Mode)

Editor prompts should be even narrower:

Include:

Exclude:

Review outputs SHOULD be structured:


7) Cadence Enforcement

Cadence rules come from the template and influence both PLAN and REVIEW:

Template cadence: Schema Templates