THE POKHRAN PROTOCOLS // VOLUME 5 // CHAPTER 17

Chapter 17: Patterns and Slots (The Syntax of Molds)

Token-Level Addressability: The Pattern Array interface

The Dredge Language (DL) treats the prompt not as a stream of text, but as a sequence of addressable components. The fundamental data structure is the Pattern Array.

type Pattern = Array<Anchor | Slot>;

Unlike a raw string, an Array allows us to mechanically inject control codes, stop sequences, and formatting markers between semantic units.

[IMAGE PROMPT: A diagram showing a ‘Pattern Array’ as a horizontal timeline. ‘Anchor’ blocks are solid concrete blocks. ‘Slot’ blocks are wireframe cages waiting to be filled. The timeline flows left to right, showing how the model’s attention ‘trips’ over the Anchors and ‘falls’ into the Slots.]

The Slot Definition: Metadata (Name/Description) as a tuning lever

A Slot is a typed container for latent generation. It is defined by three properties:

  1. Name (Identity): The immutable key used in the output JSON. (e.g., root_cause).
  2. Description (Instruction): The semantic guidance for the model. (e.g., “The verified origin of failure”).
  3. Type (Constraint): The structural enforcement. (e.g., string, number, enum).

In the Visual IDE, a Slot appears as a variable node. You can “tune” the Description slider (Generic -> Specific) without breaking the code that depends on the Name.

[IMAGE PROMPT: A close-up UI mock-up of a ‘Slot Inspector’ panel. The user is editing a Slot named ‘root_cause’. A dropdown menu allows selecting ‘Constraint Level’ (Loose, Strict, Code Golf). A text field for ‘Description’ shows auto-complete suggestions based on the Anchor text.]

Structural Consistency: Bridging the gap between string and JSON

The Dredge Compiler guarantees that the output matches the Mold. It does this by wrapping the entire Pattern in a hidden Schema Envelope.

When you define: ["Reasoning:", {name: "trace"}, "Verdict:", {name: "result"}]

The Compiler silently generates a JSON Schema:

{
  "type": "object",
  "properties": {
    "trace": { "type": "string" },
    "result": { "type": "string" }
  },
  "required": ["trace", "result"]
}

This Schema is injected into the model’s “System Constraint” layer (if supported, like Gemini/OpenAI). The user never sees this complexity; they just see the Pattern. The Platform handles the “Bridging” between the fluid Pattern and the rigid Schema.

Formal Grammar of a Mold

A valid Mold must obey Cognitive Grammar. Just as English has Subject-Verb-Object, Dredge has Anchor-Slot-Anchor.

[IMAGE PROMPT: A ‘Linter’ view in the Dredge IDE. The user has written a Pattern with two consecutive Slots ([Slot] [Slot]) without an Anchor between them. The IDE highlights the gap in red with a warning: ‘Ambiguous Transition: Models may hallucinate boundaries. Insert a geometric Anchor (e.g., newline or colon) to separate these Slots.’]