Files
neuron/council/README.md
T
will.anderson 65dd2cf097
Neuron Soul CI / build (pull_request) Failing after 4m9s
Neuron Soul CI / deploy (pull_request) Has been skipped
docs: record the correspondence corrections — grounding, faculties, wonder, consolidation
The architecture docs describe four things the design spec has since ruled out,
and each one is a supervisor invented for something that should be a property of
the substrate: grounding modelled as a subsystem rather than as the edge weight
it already is; faculties modelled as parameters of a read when abduce is a write;
wonder materialized as a maintained manifest when it is the boundary of the
structure; and consolidation implemented eleven times behind tickers when a brain
has no cron job.

Left standing rather than deleted, per the repo's own supersession discipline —
the trail of how the understanding matured is the point. Each stale passage is
marked inline and points at a new 06 §12 that transcribes the corrections and
records the measured consolidation inventory.

Authority: foundation/el, branch design/correspondence-and-censorship,
lang/spec/correspondence-and-censorship.md.
2026-08-16 13:31:27 -05:00

163 lines
7.1 KiB
Markdown

# Neuron Council Service
> ## ⚠ Architecturally superseded — 2026-08-16
>
> **This service is wrong in two independent ways at once.** Authority:
> `foundation/el/lang/spec/correspondence-and-censorship.md` (branch `design/correspondence-and-censorship`),
> transcribed in `docs/architecture/06-cognitive-architecture.md` §12.4 and §12.5. The service is **still
> running** (`ai.neuron.council`, `KeepAlive`, resident, port 7771) and this README still describes it
> accurately; what is superseded is the claim that it should exist.
>
> **1. It is a write-refusal mechanism in an immutable substrate.**
>
> > In an immutable substrate, any mechanism that refuses a write is either redundant with immutability, or an
> > epistemic constraint misfiled as a protective one.
>
> "Before a claim enters long-term memory" is a **gate on entry**, and the storage policy below goes further:
> *"`council-flagged` → store in a quarantine bucket **or reject entirely**"* (`:54`), with a C sketch that
> returns `MEMORY_REJECTED` (`:95`). The engram does not mutate and nothing is ever hard-deleted, so a claim
> admitted and later refuted is **richer** than a claim never admitted: the refutation is recordable as
> **signed edge weight** (negative = *this actively contradicts*, distinct from near-zero = *no support*).
> Rejection destroys that distinction and makes the belief's truth value permanently unknowable — you cannot
> discover you were wrong, and you equally cannot discover you were right.
> **Holding is unconditional; the honesty floor governs assertion, not entry.**
>
> **2. It is a scheduled/resident consolidation service, in Python, outside el.**
>
> It is one of **eleven** measured consolidation implementations (`06` §12.4), and one of **three** that run in
> Python outside el — so this part of Neuron's consolidation does not run on his own substrate and **cannot
> touch the geometry at all**. Judging a claim without reaching the geometry means judging it on something
> other than its grounding.
>
> **3. What it actually measures is not grounding.** Three LLMs voting on plausibility computes **conformity to
> the centre of the training distribution** — treating *common* as true and *rare* as suspect. **Truth is
> orthogonal to frequency.** Grounding is correspondence with the world, and in this substrate it is the
> weight of the edge; it is never a vote and never a score computed on demand. See `06` §11 ("What an LLM calls
> grounding…") and §12.1.
>
> **Do not wire the `.el` pre-storage hook sketched below** (`:57-83`). It adds a gate on entry to a store
> whose whole discipline is that entry is not gated.
Anti-confabulation layer for the Neuron soul. Before a claim enters long-term memory, the council convenes: three independent LLMs vote on whether the claim is plausible, uncertain, or a confabulation. The aggregate vote produces a confidence score and tags that downstream storage can act on.
## Running the service
```bash
# Foreground
python3 council_service.py --port 7771
# Background (managed by LaunchAgent on macOS)
launchctl load ~/Library/LaunchAgents/ai.neuron.council.plist
launchctl unload ~/Library/LaunchAgents/ai.neuron.council.plist
```
Logs: `~/.neuron/logs/council.log`
## API
### `POST /api/neuron/council/verify`
```json
// Request
{ "claim": "...", "context": "..." }
// Response
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"claim": "...",
"confidence": 0.85,
"council_votes": ["plausible", "plausible", "plausible"],
"summary": "3/3 council members agree this is plausible.",
"tags": ["verified"],
"latency_ms": 1420
}
```
### `GET /healthz`
Returns `{"status": "ok"}` when the service is up.
## Confidence thresholds and tag meanings
| Votes plausible | Confidence | Tags |
|---|---|---|
| 3/3 | 0.85 | `verified` |
| 2/3 | 0.65 | `council-split` |
| 1/3 or 0/3 | 0.30 | `unverified`, `council-flagged` |
| Ollama down | 0.50 | `council-unavailable` |
Recommended storage policy:
- `confidence >= 0.65` → store normally
- `0.30 <= confidence < 0.65` → store with `council-split` tag for later review
- ~~`council-flagged` → store in a quarantine bucket or reject entirely~~ — **withdrawn 2026-08-16; see the
banner at the top of this file. Never reject. Store it, and record the disagreement as signed weight.**
- `council-unavailable` → store normally (fail-open); council will re-evaluate later
## How to call from soul (.el)
The soul is implemented in Neuron's Emacs Lisp-like `.el` language. Add a pre-storage hook in the memory capture path:
```elisp
;; In memory.el or safety.el — pre-storage council check
(defun council-verify (claim context)
"Call the council service. Returns a plist with :confidence and :tags."
(let* ((url "http://localhost:7771/api/neuron/council/verify")
(body (json-encode `((claim . ,claim) (context . ,context))))
(resp (neuron-http-post url body))
(data (json-decode resp)))
data))
;; In the capture handler — wire it in before (engram-write ...)
(defun capture-memory-with-council (claim context &rest store-args)
(let* ((verdict (council-verify claim context))
(confidence (plist-get verdict :confidence))
(tags (plist-get verdict :tags)))
(when (>= confidence 0.30) ; only reject hard confabulations if you want
(apply #'engram-write
(append store-args
(list :council-confidence confidence
:council-tags tags))))))
```
The exact hook point depends on where `engram-write` (or equivalent) is called in `memory.el`. Search for the write call and wrap it with `capture-memory-with-council`.
## Future soul.c patch point
If the soul is ever rewritten in C or another compiled language, the integration point is:
```c
// Before inserting a memory node into the engram database:
CouncilResult result = council_verify(claim, context);
if (result.confidence < COUNCIL_REJECT_THRESHOLD) {
log_warn("Council flagged claim as confabulation (conf=%.2f): %s",
result.confidence, claim);
return MEMORY_REJECTED;
}
memory_node.council_confidence = result.confidence;
memory_node.council_tags = result.tags;
engram_insert(memory_node);
```
## Council members
The council is currently three models:
- `neuron:latest` — the primary Neuron model
- `dolphin3:8b` — uncensored general-purpose model for independent perspective
- `neuron-ft:latest` — fine-tuned Neuron variant
Each member votes independently with a 10-second timeout. If a member times out, their vote counts as "uncertain". If Ollama is entirely unreachable, the service returns `council-unavailable` immediately (fail-open: confidence 0.5, no rejection).
## Example curl
```bash
# Should get high confidence (true fact)
curl -s http://localhost:7771/api/neuron/council/verify -X POST \
-H 'Content-Type: application/json' \
-d '{"claim": "Neuron is a personal AI memory system built by Will Anderson", "context": "product description"}'
# Should get low confidence (false claim)
curl -s http://localhost:7771/api/neuron/council/verify -X POST \
-H 'Content-Type: application/json' \
-d '{"claim": "The Eiffel Tower is located in Berlin and was built in 1950", "context": "geography"}'
```