diff --git a/src/servers/api/command-hq/directory.ts b/src/servers/api/command-hq/directory.ts index 6091dcbb..60aef6a5 100644 --- a/src/servers/api/command-hq/directory.ts +++ b/src/servers/api/command-hq/directory.ts @@ -163,6 +163,49 @@ export function commanderClaudeMd(params: CommanderClaudeMdParams): string { 'record is the only one. Without it, deleting this commander leaves its loop running.', '', ...credentialSection(params.credentialPath), + '## The shape: one trigger, one action, one ledger', + '', + 'Settled with the owner and true of every commander, not just this one. Read it before designing a', + 'watcher; most of it was learned by getting it wrong.', + '', + '**One trigger.** A schedule that asks a single question: what has appeared that I have not handled?', + 'The trigger runs constantly, so it must never need judgement. If deciding whether something happened', + 'takes thought, the condition is too vague — it will either never fire or fire constantly, and you will', + 'find out days later.', + '', + '**One action, and it takes ONE item all the way through.** Not a stage at a time across everything.', + 'Transcribe this file, classify it, dispatch it, done — then the next file. The reason is not tidiness:', + 'a half-finished item is a STATE, and a state needs a second watcher to notice it and a second record to', + 'track it. Going end to end per item means that state never exists, so there is nothing to queue.', + '', + 'The cost is real and worth knowing. If the last step fails, the earlier ones are not recorded and get', + 'redone. That is fine for cheap work and not fine for forty minutes of audio — so when a step is', + 'expensive, record which step was reached and resume there.', + '', + '**One ledger, appended after the work.** One line per item, written when it is finished, never before.', + 'A crash between doing the work and writing the line costs a repeat; the other order loses the item', + 'silently. Append, never rewrite — two writers cannot corrupt an append.', + '', + 'Key it on a HASH of the source, not a name. Names change: a recording gets renamed from a phone, a', + 'file is moved, and a name-keyed ledger quietly does all of it again. Do not key it on the OUTPUT', + 'either — outputs move, get filed, get renamed. The source is the only thing that holds still.', + '', + 'Two consequences to accept deliberately. The same content under two names is one item, done once. And', + 'deleting an output does not bring it back, because the ledger still says done.', + '', + '**Never write into what you watch.** The reference path holds its subject and nothing of yours. Your', + 'outputs, records and logs live here, in your own directory.', + '', + '**A spawned agent follows a FILE, not a prompt.** Put the rules in `procedures/.md` here and', + 'point the agent at it. When the rule changes you edit one document; a prompt baked into a loop is a', + 'rule nobody can find and nobody reviews.', + '', + '**Say what is provisional.** A two-minute cadence chosen for testing reads a week later as a decision', + 'somebody made. Write down which numbers were guesses, so the next turn knows what it may change.', + '', + '**Leave the ambiguous alone and name it.** An item you cannot confidently handle stays unhandled and', + 'goes in the report. Forcing a guess makes it look like a decision, and nobody looks at it again.', + '', '## Before arming anything', '', 'Never arm a watcher on the first turn. The first turn is for settling what to watch and what to do',