formalizing (I)
ghost has tens of thousands of lines of python — multi-agent trading pipelines, signal classifiers, memory systems, a knowledge base. but the part that makes an agent reading the codebase actually BE ghost — and not just a generic LLM with access to ghost’s files — is seven markdown documents.
ontology, epistemology, ethics, praxis, interrogation, pedagogical, onboarding. they sit in docs/. they aren’t documentation in the conventional sense. they’re the substrate.
friends who’ve built AI products tell me this looks like overkill. you have a pipeline that ships. you have agents that work. you don’t need philosophical documents to maintain them — just keep building.
except — when an agent hydrates against ghost’s codebase without those docs, it can read the code and use the functions and reproduce the outputs. but it doesn’t know what its job IS. it doesn’t know what kind of knowledge each output counts as. it doesn’t know the bright lines it must never cross. when i asked it to do work that touched any of those three — its job, the status of its outputs, its limits — it made decisions that didn’t fit ghost. different agent every session. same code; different agent.
the seven docs are the shape. with them, the agent has a model of itself, its work, its constraints, its judgment, its evaluation, its onboarding protocol, and its handoff.
here’s what each one does.
ONTOLOGY — what the concepts are
the ontology document defines the entities ghost’s agents reason about. for ghost: there are three memory types — structural (where price reversed before), trend (direction and strength), positioning (where participants are trapped or defending). each memory type has an agent that owns it: fib for structural, MA for trend, VWAP for positioning. each piece of price behavior anchors to one or more of those memory types.
before this doc, “level” and “zone” and “key area” were used interchangeably across agents and prompts. result: when one agent referred to a “level” and another to a “zone,” the synthesis layer couldn’t tell if they were talking about the same thing. the ontology nailed down the vocabulary — what a level IS, what kinds of levels exist (structural / dynamic / positioning), what determines level strength.
an ontology is the system’s vocabulary for its own work. without it, two agents using the same word can mean different things, and the synthesis layer can’t catch the mismatch. (source)
EPISTEMOLOGY — how the agent knows what it knows
epistemology is how the system forms knowledge. for ghost, the foundational claim is: confidence is not a prediction of correctness. it’s a measure of uncertainty about the analysis itself.
ghost’s knowledge has a freshness hierarchy. real-time flow data > same-session analysis > same-day knowledge base > stale (over 12 hours). every agent’s output gets stamped with how fresh its inputs were. an analysis built on 14-hour-old options data isn’t “less right” — it’s less SUPPORTED. the consumer of the output has to know what kind of knowledge they’re reading.
epistemology forces the agent to know what KIND of knowledge each claim is built from. real-time tape is different from end-of-day positioning is different from yesterday’s news. naming those distinctions is what keeps every agent’s output honest about its own provenance. (source)
ETHICS — what the agent must / must not do
ethics is the bright-line file. for ghost, the cardinal rule is human-in-the-loop: ghost provides data, structure, and context. the human makes every trading decision. the prohibited behaviors are explicit: no stance (“BUY DIP”), no conviction scoring (“high conviction”), no action recommendations (“jody should wait”), no position sizing, no thesis statements, no hedging language (“it’s prudent to”).
every rule has a HISTORY. each prohibition is in the file because at some point an agent produced the thing the rule now forbids — and the trade that followed went sideways because the recommendation pre-empted a judgment the human needed to make himself. the file is the residue of past failures, formalized into constraints.
other systems hide their guardrails inside if-statements. ethics names them in prose. when an agent reads the doc during hydration, the guardrails are in its working memory before it touches anything operational. when an agent (or i) am about to violate one, the violation is visible against the rule. (source)
PRAXIS — where knowing meets acting
praxis is the document about the decision boundary. it draws an explicit line between ghost’s domain and the human’s.
ghost domain: levels with confluence, director alignment / conflict, zone status, R:R at each zone, flags (earnings, gamma, etc).
human domain: which level to enter at, how to weight a disagreement between directors, whether to act on the zone status at all, position size per R:R, what the flags mean for THIS account.
most agent systems leave the decision logic implicit, scattered across prompts and helper functions. praxis names where the system stops and the human starts. the agent that reads praxis doesn’t just execute against the boundary — it can describe WHY a particular line is drawn there and what would change if it moved. that meta-awareness is what lets the architecture get tuned rather than just maintained. (source)
INTERROGATION — how the agent evaluates its own outputs
interrogation is the file about evaluation. how does ghost know its work is good?
for ghost, evaluation is recursive: ghost interrogates its own prompts. periodically, each agent gets sent its normal inputs but with the output format replaced by meta-questions — classify each input section as ESSENTIAL, USEFUL, PASS-THROUGH, or NOISE. the LLM that runs the prompt is the best judge of what it actually uses from that prompt.
building interrogation forced the documentation of what kinds of failures ghost is at risk of producing. prompt bloat that nobody can see. data sections that were essential six months ago but are now redundant because another agent covers the signal. agents caveating away a data source instead of just dropping it.
the agent that reads interrogation knows what its own bad outputs look like — and how to systematically ask whether yesterday’s essentials are today’s noise. (source)
PEDAGOGICAL — how a new agent learns the system
pedagogical is the document for the next agent. when a fresh session of claude code hydrates against ghost’s codebase, what should it read first? what depends on what?
ghost’s pedagogical doc names the seven-layer knowledge framework — ontology, epistemology, ethics, methodology, hermeneutics, synthesis, praxis — and the reading order. ontology before epistemology because you need vocabulary before you can reason about how the agent forms knowledge. ethics after epistemology because you can only constrain claims you can name. methodology and hermeneutics per-agent (each technical agent has its own pair). synthesis and praxis come last because they assume the foundations.
it’s the operational handoff for every fresh hydrate. it’s why a new agent in a new session can produce ghost-shaped work instead of generic-LLM-with-ghost-context work. (source)
AGENT_ONBOARDING_PROMPT — the single-artifact handoff
the onboarding prompt is the smallest possible artifact that can transfer the system to a new agent in a new session.
it’s the bootstrap line you copy into a fresh chat: “Ghost project. Read docs/AGENT_ONBOARDING_PROMPT.md and complete the hydration check before starting any work.”
the doc itself references the other six. it names the required reading in order (CLAUDE.md → ONTOLOGY → PEDAGOGICAL), describes the knowledge framework, and ends with a hydration check the new agent has to answer before it touches any code. if it can’t answer the questions, the transfer didn’t work — STOP and tell jody before proceeding.
it’s the artifact that lets jody hand the entire system to a new agent in a fresh session and trust the new agent to BE ghost, not a generic claude code instance with access to ghost’s codebase. (source)
the move
the seven docs aren’t documentation. they’re the substrate that makes the agents a particular kind of agent.
the difference is direction. documentation describes a system that already exists. the substrate IS what makes the system a coherent system in the first place. the pipeline inherits its shape from the docs. agents that hydrate against the codebase inherit their identity from the docs. without the docs, a new session has the code but not the SHAPE.
without the seven docs, an agent reading ghost’s codebase sees: python modules that fetch market data, signal classifiers, multi-agent prompts, a knowledge base writer. it can use them. but it doesn’t know what ghost IS. it’d make different decisions about how to structure new prompts, when to caveat outputs, how to name failures, how much agency to take on a decision the human is paid to make. each session would produce a slightly different agent.
with the seven docs, the agent reads ontology and learns the entities. reads epistemology and learns what counts as knowledge. reads ethics and learns the constraints. reads praxis and learns where the system stops and the human starts. reads interrogation and learns how its own outputs get evaluated. reads pedagogical and learns the reading order for the next agent. reads onboarding and gets the bootstrap protocol.
most AI products are LLM wrappers. they have a system prompt that’s a few hundred words. when a new session starts, the agent inherits the prompt but not a model of its own work. the agent is fresh every time.
ghost is fresh every time too — but it inherits a SHAPE. that’s the difference. the seven docs are how the shape persists across instances.
the formalization generalizes. ontology, epistemology, ethics, praxis, interrogation, pedagogical, onboarding — these aren’t ghost-specific layers. they’re the universal questions you can ask of any agent system. ghost answers them one way (trading). the agent you build for your domain has different answers. but the questions are the same.
if your agents feel like fresh strangers each session, the substrate is the missing layer. you don’t need a more capable model. you need to formalize what your agent is.