The organism, part by part

The product is the organism: your Hale application, plus the parts that let it be governed, changed, run and watched. Someone asks for an outcome; the…

The product is the organism: your Hale application, plus the parts that let it be governed, changed, run and watched. Someone asks for an outcome; the organism turns it into work, proposes a change in a sandbox, proves it with the toolchain, asks whoever holds the authority, applies exactly what was approved, runs it, and watches that it works. Every decision is a row in a record that lives in your git repository.

This page is the map. Each part has one job, one place in the tree, and one chapter that covers it.

How to read this section

Section titled “How to read this section”

The parts

Section titled “The parts”
part its one job where it lives chapter
genome what the organism is made of: the application’s source, the org chart and catalogs under dna/org, and the vendored core in vendor/dna; a node pulls it from the forge’s default branch your repository; the host’s git for it is dna/host/genome.hl Shaping
record long-term memory: every decision, in order, never rewound, as one commit per row under refs/dna/* dna/core/record.hl, dna/host/record.hl Memory and the record
memory working memory: the ledger of the day’s work, claims, the graph, protected evidence; Postgres, a role per client dna/core/memory_spine.hl, dna/host/memory.hl Memory and the record
nerves carry facts between parts after their row has landed: NATS JetStream, one stream per organization, one user per part dna/core/nerves.hl, dna/host/nerves.hl, dna/nats.conf The nerves
face where the organism shows itself to people and takes their intent: a browser surface the head serves dna/face/ The head and the face
head the edge API: sessions, principals, commands answered with a receipt; it never performs work dna/api/ The head and the face
body the hosts the organism runs on, and the lease that says which body runs the record dna/core/infrastructure.hl, dna/host/infra.hl The heart and the body
spine the program every node runs: it relays the record’s requests, projects the record into memory, admits and settles work, runs the workflows dna/host/host.hl over the organization in dna/org/main.hl The spine
legs the workers: each claims an attempt through the head, wears its hat, hands the outcome back, and holds nothing between tasks dna/core/legs/, performers in dna/org/work.hl Legs, hands and voice
hat one content-addressed context per unit of work dna/core/hat.hl Legs, hands and voice
hands the tools a Work’s output contract gives a performer, and what runs them: git, the forge, the toolchain, the record’s reads dna/core/contracts.hl, dna/core/tools.hl, dna/core/legs/hands.hl Legs, hands and voice
voice the one seam to any model: the catalog, the model mapping, the adapters, the tape dna/core/models.hl, dna/core/model_map.hl, dna/core/tape.hl, the catalog in dna/org/models.hl Legs, hands and voice
heart the application itself; its pulse is the events it publishes on its own subjects, each landed as a reading row your application’s seed; the host lands its events in dna/host/pulse.hl The heart and the body
senses the readings every long-running part serves, kept in one store dna/core/senses.hl, the store’s config in dna/senses.yml Senses and reflexes
reflexes reactions that need no plan: an instance that is down is restarted dna/reflexes/main.hl; the node acts in dna/host/reflex.hl Senses and reflexes
skin the trust boundary: the vault, roles and accounts, OIDC, sealed credentials, closures recorded as violations dna/host/secrets.hl, dna/core/principal.hl, dna/oidc/stub.hl The skin

Schedules, which say when a workflow runs and who convenes it, have their own chapter: Schedules.

Two rules

Section titled “Two rules”

Every part keeps two rules. They are why nothing is half-written and why a restart loses nothing.

One store per step. A workflow step writes to exactly one store, by that store’s one writer, and the next step reads what the previous one made durable. A workflow definition names the store of each step in one word (record, forge, genome, heart, graph, nerves, memory, vault or host), and a step that names none, or two, is refused before anything runs. A write whose subject moved since it was read is refused and decided again. There is no transaction spanning two stores, and none is needed. The spine has the engine.

Row first. Every live signal is a row before it is sent. When you ask for something, the command writes a row and stops; a node relays that row onto the nerves until the record holds the answer. Events name a row by id, arrive at least once, and are consumed once by that id. An event from outside, such as the application’s own, is a signal, not a fact: it lands as a reading.recorded row before anything acts on it. The nerves has the relay.

Trust tiers

Section titled “Trust tiers”

Each part sits in one tier. A tier is defined by what it is handed and what it is never handed.

tier who is handed is never handed
devices a person’s browser a session cookie from the head keys, git, a shell, the broker
identity and the forge an OpenID provider; the forge (GitHub through gh, behind the core’s Forge interface) who a person is; where the genome and the record are pushed, and the verdicts on pull requests anything operational
the head the edge API and the face it serves sessions; the mapping from a principal to positions; its own checkout of the record; memory’s head role (take and fence a claim, read, write the ledger in its people’s names); a broker user that may subscribe and never publish the spine’s database role
the body the spine, run by hale dna run or dev on each node memory’s spine role; the nerves’ spine user; the body lease the owner’s and the head’s credentials, for memory and for the nerves
the body’s legs hale dna work the lease on the attempt it claimed; the model keys in the vault of the machine it runs on a database role: everything goes through the head
the heart your application its own store and secrets; a broker user that may publish only on its own subjects, <org>.app.<name>.> the record, DNA’s database, DNA’s other credentials, DNA’s subjects
private services memory (Postgres), nerves (NATS), the vault, the senses’ store (Prometheus), the reflexes servers that listen on 127.0.0.1 only; the reflexes hold the store’s read URL and a publish-only user reachability from a device
external a model’s API one prompt and one key, per call anything it was not sent

The local vault is one directory per user. Any program that user runs could read any entry by name, so what keeps a part to its own credential is what it is handed, not what it could read. The skin covers the vault and the accounts.

What it will and won’t do

Section titled “What it will and won’t do”

Plainly, so you can decide whether it fits.

It will

Section titled “It will”

It won’t

Section titled “It won’t”

What the evidence supports

Section titled “What the evidence supports”

Before the apply path was built, reviewers decided planted changes from the structural diff alone, the source diff alone, and both. The source diff and the combined view decided every case; the structural view alone decided the rule-backed cases and correctly held on the rest. So the combined view is what you get, and what the Leader gets. The write-up is dna/kill-test/WALKTHROUGH.md in the hale repository.

The contract behind every statement on these pages is spec/dna.md.