Reference·The organismIndex

The organism

What runs when you type nodecode, what it keeps, and what happens when it stops.

.mdllms.txt

An organism is a running Nodecode. There is one per home, and every terminal you open talks to it. Below are five things people do to it, each done two ways.

A second agent

A home has one store, and one process owns it: a nodecode serve that the first shell started. Anything else that wants the store finds it taken.

A shellexit 0
nodecode serve
cell ada: layer, 1 definition
[CP-ISSUE-20260912-001] gateway ready
Afterwards
ps -o pid,ppid,args
PID PPID COMMAND
86 83 nodecode
1115 1113 nodecode
2111 86 setsid -w nodecode serve --store /home/you/.nodecode/history.db
2113 2111 nodecode serve --store /home/you/.nodecode/history.db

The store is taken, so it says ready and exits 0. Nothing new is running.

Done with a terminal

The organism is a child of the shell that started it, and it lives as long as that shell does. Later shells only attach.

Second shell, mid-turn
One second later
ps -o pid,ppid,args
PID PPID COMMAND
86 83 nodecode
707 86 setsid -w nodecode serve --store /home/you/.nodecode/history.db
709 707 nodecode serve --store /home/you/.nodecode/history.db

The organism stops with it. The other shell starts a new one within a second, on the same port, and its turn picks up where it stopped. A value set with setf is gone.

With the background gateway on, the service manager runs the organism instead, and no terminal stops it. See The gateway.

A launch looks stuck

The owner holds a lock on history.db.lock. The operating system frees it when the owner exits, however it exits.

After the next nodecode
ps -o pid,ppid,args
PID PPID COMMAND
20 15 nodecode
34 20 setsid -w nodecode serve --store /home/you/.nodecode/history.db
36 34 nodecode serve --store /home/you/.nodecode/history.db
122 119 nodecode
130 122 setsid -w nodecode serve --store /home/you/.nodecode/history.db
132 130 nodecode serve --store /home/you/.nodecode/history.db
The new shell

The first organism still holds its lock, on a file that no longer exists. The next launch starts a second organism on the same store, on a new port. Two processes now write one history.

Remember a value

The organism keeps a definition, not a state. A top-level defun or defparameter is written to your layer and loads at every start. Anything else lives only as long as the process.

Before
After a restart

Set in this process only. After a restart, boundp says NIL, while a defun from the same hour is still there.

Change a kernel function

The kernel, nodecode.kernel, holds the store, the lock and the loader. The organism locks it at boot. Everything else, the turn loop included, is nodecode.evolved, and the model may redefine it.

First shell

The lock refuses it, and nothing is written to the layer.

One tool, one log

The organism has one tool, eval. A shell command, a file edit and a new definition are each a Lisp form in an eval call.

PROMPTCONTEXTROUNDANSWEREVALTHE LOG~/.nodecode/history.db
A turn. A tool call runs as a cell of Lisp in the running image. Its result returns to the round. A turn takes as many rounds as the work needs. Each station writes a durable fact.

Every fact is an event in ~/.nodecode/history.db: a prompt, an answer, a tool call, its result. The transcript in every shell and the model's context are both read from it. History the model no longer sees stays in the log. See Context and recall.

The gateway answers on 127.0.0.1, on the port this store used last. There is no port option. Shells find it in history.db.owner. See Files.

Esc

    Loading the index…

    ↑↓ moveEnter openEsc close