LAYER 03 · Trace the agent spine

A prompt is not one string

Stable identity, dynamic context, variables, tool schemas, and call config form a reconstructable EpochHeader

18 min3 source anchorsupstream@47f9438
sections + variables + contexts + tool schemas
The question this chapter resolves

How can plugins add model-visible context without everyone editing one systemPrompt?

Build intuition

It is a newsroom: desks contribute independently, an editor lays them out by public order and scope, and each edition preserves the full front-page snapshot.

MECHANISM

Mechanism

ctx.systemPrompt registers sections, contexts, variables, and tool-schema providers. Every step assembles a deterministic snapshot; same-name agent-scoped contributions can shadow deployment defaults.

Call config, rendered system text, and tool schemas are logged as request/header. A change snapshot is written only when the envelope changes, keeping requests reconstructable from log plus code.

Step 1 of 5

Collect contributions

Resolve sections, variables, and schemas by scope.

INVARIANTS

What extensions must preserve

  • Tool visibility, schema, and guidance must stay synchronized
  • Ordering is part of the public protocol
  • Request headers log full snapshots, not incremental patches
FAILURE MODES

The tempting wrong turns

  • ×Putting dynamic file content into stable persona
  • ×Silently rendering missing variables as empty
  • ×Reusing an old request header after tool restrictions change
VERIFY IN SOURCE

Do not trust the conclusion—verify it

These anchors are pinned to official deepseek-harness@47f9438; account for later breaking changes when reading current upstream.

KNOWLEDGE CHECK

Pause for ten seconds before revealing

Why do tool schemas belong to prompt assembly rather than only Tools?

Why the next chapter follows

The assembled request enters the LLM seam. Next we see how one streaming vocabulary isolates provider differences.

Learn DeepSeek Harness

An independent learning project. Explanations derive from source; upstream remains authoritative.