# Campaign state A campaign keeps its state in two places, and nothing lives in both. - **The mind.** Questions, rulings, cut specs, reports, verdicts, findings, follow-ups and resolutions are typed documents in the instance's mind, held by Huginn and reached through the `eureka-state` MCP tools. Status is derived from them on every read; nobody writes it. - **The prose.** A target document and a map document, committed in the repo the campaign changes. They keep only what no kind carries: body facts (probes and their results), the model page (step 0b), and rationale. The typed `target` points at the target document through `target.doc`. The shapes below are the leaf's (`epiphany-pipeline`, pinned by Huginn) and the organ's (`huginn-mind`). Where this page and the tools' own schemas disagree, the tools are right and this page is stale. ## The tools The instance and the daemon are the server's configuration (`EUREKA_INSTANCE`, `HUGINN_ENDPOINT`), never an argument. | Tool | Input | Answer | |---|---|---| | `whoami` | `{}` | `{ instance, endpoint, reachable, status }`. `status` is `{ instance, schema_epoch, documents, receipts, index }`, and `index` is `Current`, `Reconciling`, `Behind`, `Failing` or `Refused`. When unreachable, `error` says why. | | `admit` | `{ faculty, agent, session, documents }` | `Committed { receipt_id, committed_at, writes }`, `AlreadyAdmitted { receipt_id }`, `Conflict { identities }` or `Refused()`. One to 64 documents, admitted whole or not at all. | | `view` | `{ id: { kind, id } }` | `{ id, document, admission, status }`, or `null`. | | `query` | `{ selection, semantic? }` | `{ matched, as_of, next, items, edges }`. `items` is `Headers([...])` or `Documents([...])`. | - `faculty` is one of `SelfFaculty`, `Imagination`, `Hands`, `Soul`, `Life`, `Eyes`, `Operator`. It is attribution, not authority. - `agent` names the admitting agent. `session` is the campaign session label Self gives in every brief, so that sessions sharing one mind stay tellable apart. - A document on the wire is `{ "kind": "", "value": { ... } }`, with the kind in snake case (`cut_spec`). A reference is `{ "kind": "", "id": "" }`, with the kind in Pascal case (`CutSpec`). - **A refusal is an answer.** It names the rule, for example `CitesResolvedDocument`, `ResolutionOutOfSequence` or `PromiseWithoutVerdict`. Fix the batch and admit again. An exact replay answers `AlreadyAdmitted`, so retrying a batch is safe. A key, format or bound error arrives as `Refused(Document(..))` with the field and value: fix it and resend. `Refused(Unavailable)` means a store fault: retry once, as for `isError` `Unavailable`. The retired faculty name for `Life` is refused in query selections; stored receipts that carry it still decode. - **`isError: true` means no answer:** `Unavailable` (the daemon is down or unreachable), `Rejected` (it refused the envelope), `Misconfigured`, `TooLarge`, `Unencodable`, `InvalidInput` or `Internal`. ### When the organ does not answer This is the one rule for every faculty. 1. **The tools are missing** from the session's tool surface: stop and tell the operator (a subagent tells Self). A server registered after the session started appears only in a new session. Never fall back to prose. 2. **`Unavailable`:** retry the same call once. A cold semantic embed after an idle spell took over 15 s live, which is the client's whole timeout. Retrying `admit` is safe, because an exact replay answers `AlreadyAdmitted`. 3. **`InvalidInput` or `TooLarge`:** the call is wrong, not the organ. Fix it (the arguments, or a narrower selection or smaller batch) and retry, as for a refusal. 4. **`Unavailable` after the retry, or any other `isError`:** stop. A subagent reports the error and the step it stopped at, and stays resumable: Self continues it with `SendMessage` once `whoami` answers. Never send the record to Self as prose, and never keep it anywhere else meanwhile. The mind is the only store. ## The document set A key is `::`. The leaf derives it, and admission refuses a mismatch. The root is the campaign slug, or the instance for `instance`, `stewardship` and `hand_off`. | Kind | Local | Admitted by | Carries | Cites | |---|---|---|---|---| | `instance` | `self` | exists (`eureka:instance:self`) | instance, display name, host | | | `stewardship` | `.n` | Self | instance, repo, sequence, note | | | `campaign` | `self` | Self | title, repos, working branch, target doc | | | `target` | `r` | Self | invariants (`label`, `statement`), not in scope, canonical implementations, doc | | | `question` | `