feat(epistemics): record assertions between observations and beliefs
A statement made to a mind is now three things kept apart: the observation that it arrived, an append-only assertion (attributed actor, stance, certainty, modality, negation, reported or quoted speech, hypothetical status, interpretation confidence and notes), and, only for factual assertions, one piece of evidence for a proposition belief attributed to whoever actually stands behind it. Reported speech is attributed to the person reported and weighed as second-hand; hypotheticals, questions and imperatives create no belief; expressed doubt counts against; a possibly sarcastic remark is recorded with low interpretation confidence rather than guessed at. Interpretation is deterministic code; a model may enrich the claim list but never sets stance or confidence. Association no longer treats conversational turns as world events: hypotheticals, questions, requests and consecutive turns by one speaker cannot seed causal hypotheses. Adds internal/epistemics, migration 0018, the assertions API, assertions on belief pages and in belief detail, a shared end-to-end test harness (tests/harness), end-to-end tests for eight speech patterns, and updates the milestone test to the new provenance.
This commit is contained in:
@@ -37,6 +37,10 @@ confidence = sigmoid( logit(prior) + 1.5 × (for × diversity − against) )
|
||||
|
||||
Every evidence row records its `derivation`, `family`, `root_ids` (the originating events or memories) and a `provenance_status`. Rows written before provenance existed are marked `legacy_unknown` with `family = source`; no ancestry is invented for them. The breakdown (prior, per-family contributions, for, against, families, diversity, log-odds, formula, notes) is stored with every version and shown on the belief page under "Independent sources".
|
||||
|
||||
## Assertions as evidence
|
||||
|
||||
Statements people make reach beliefs only through assertions (`docs/conversation.md`). An `assertion` evidence row carries the attributed actor as its family, the source message as its root, and a weight that already reflects hedging, reporting and interpretation confidence. Nothing is silently upgraded: a claim stays a claim until evidence from another family arrives.
|
||||
|
||||
## Status
|
||||
|
||||
Derived from the breakdown unless an operator pinned it:
|
||||
|
||||
@@ -1,5 +1,16 @@
|
||||
# Conversation
|
||||
|
||||
## Observation, assertion, belief
|
||||
|
||||
Three things are kept apart when somebody speaks to a mind:
|
||||
|
||||
1. **Observation.** The message arrived. This is certain and is recorded as an `observation` event with the speaker, channel and trust level.
|
||||
2. **Assertion.** The speaker took a stance on a proposition. This is recorded in the append-only `assertions` table with who is *attributed* (the speaker, or the person they quote or report), the stance (asserts, denies, doubts, questions, supposes, reports), the certainty they expressed (asserted, hedged, uncertain, emphatic), the modality (factual, hypothetical, reported, quoted, imperative, question), negation, and an **interpretation confidence** with notes that say how sure the reading itself is (possible sarcasm, diffuse attribution, a conditional). Interpretation is deterministic (`internal/epistemics.Interpret`); a model may enrich the claim list but never sets stance or confidence.
|
||||
3. **Belief.** Only factual assertions, direct or reported, create or feed a proposition belief, as **one piece of evidence** whose family is the attributed actor and whose weight follows the stance, certainty, second-handness and interpretation confidence. Hypotheticals ("imagine Bob…"), questions and imperatives create no belief. An expressed doubt ("…but I don't believe her") records the reported claim *and* adds the speaker's doubt as counter-evidence. Reported speech is attributed to the person reported and weighed as second-hand.
|
||||
|
||||
So "Andy says Steve steals laptops" yields an assertion by Andy (high interpretation confidence) and a `claim` belief about Steve at claim confidence, resting on one family (`actor:andy`). Repeating it does not strengthen it; an independent source would. "Alice thinks the server is compromised" is attributed to Alice, marked reported, and weighs less. "I have high confidence that Andy asserted X" and "I have low confidence that X" are therefore two different rows and two different numbers.
|
||||
|
||||
|
||||
A message to a mind is never forwarded to a model. It goes through the cognitive cycle (spec §38):
|
||||
|
||||
```
|
||||
|
||||
@@ -2626,6 +2626,118 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/minds/{mind}/assertions": {
|
||||
"get": {
|
||||
"operationId": "assertionsList",
|
||||
"summary": "list assertions: who took what stance on which proposition",
|
||||
"x-required-role": "observer",
|
||||
"tags": [
|
||||
"minds"
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"$ref": "#/components/responses/Error"
|
||||
},
|
||||
"403": {
|
||||
"$ref": "#/components/responses/Error"
|
||||
},
|
||||
"404": {
|
||||
"$ref": "#/components/responses/Error"
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "mind",
|
||||
"in": "path",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "mind slug or id"
|
||||
},
|
||||
{
|
||||
"name": "actor",
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "belief",
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "stance",
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "limit",
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/v1/minds/{mind}/assertions/actors": {
|
||||
"get": {
|
||||
"operationId": "assertionActors",
|
||||
"summary": "summarise asserting actors",
|
||||
"x-required-role": "observer",
|
||||
"tags": [
|
||||
"minds"
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"$ref": "#/components/responses/Error"
|
||||
},
|
||||
"403": {
|
||||
"$ref": "#/components/responses/Error"
|
||||
},
|
||||
"404": {
|
||||
"$ref": "#/components/responses/Error"
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "mind",
|
||||
"in": "path",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "mind slug or id"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/v1/minds/{mind}/beliefs": {
|
||||
"get": {
|
||||
"operationId": "beliefsList",
|
||||
|
||||
@@ -5,14 +5,15 @@ A conversation is one of several perception channels, not a privileged path to a
|
||||
1. **Message.** A person posts a message in a conversation (the interface, `noemactl ask`, or the API). It is stored with the conversation, the actor and a link to the event it becomes.
|
||||
2. **Observation.** The message is appended as an `observation` event with `trust=user`, the conversation as its channel and the message text as data. It now enters the mind's history like anything else it perceives.
|
||||
3. **Perception.** The perceive process analyses the observation deterministically: sentences, entities, claims, questions, requests, dates, sentiment words. If a model is configured for the `perceive` role and the cycle budget allows, the analysis is enriched with a structured JSON result; the model's output is validated against a schema and any capability-like or policy-like language in it is flagged rather than obeyed.
|
||||
4. **Cognition.** The perception competes for the workspace. Retrieval recalls related memories; beliefs are created or updated from claims (as claims, at claim confidence); contradictions are detected; goals and predictions may follow.
|
||||
5. **Intent.** If the message asks something or expects a reply, the executive builds a **response intent** from real state: what was asked, which beliefs answer it with what confidence, what the mind does not know, which memories are relevant, and what the personality says about tone. Introspective questions ("what do you believe about X", "what can you do", "why did you say that") are answered from beliefs, the self-model and events, never invented.
|
||||
6. **Language.** The intent is rendered deterministically from templates, or, when a model is configured for the `respond` role, sent to the model with the intent as the thing it must stay grounded in. The reply is a `response_generated` event with its evidence references and the model call, if any.
|
||||
7. **Message back.** The reply is stored in the conversation with links to the event and the model call. The interface shows the reply with an evidence panel; the API returns the same structure.
|
||||
4. **Assertion.** Each claim in the message is interpreted deterministically into an assertion: who is attributed (the speaker, or the person they quote or report), their stance, how firmly they put it, whether it is hypothetical, reported, quoted or negated, and how confidently the reading itself holds. The assertion is recorded whatever happens next.
|
||||
5. **Cognition.** The perception competes for the workspace. Retrieval recalls related memories; only factual assertions feed a proposition belief, as one piece of evidence attributed to whoever stands behind it; hypotheticals and questions create none; expressed doubt counts against. Contradictions are detected; goals and predictions may follow.
|
||||
6. **Intent.** If the message asks something or expects a reply, the executive builds a **response intent** from real state: what was asked, which beliefs answer it with what confidence, what the mind does not know, which memories are relevant, and what the personality says about tone. Introspective questions ("what do you believe about X", "what can you do", "why did you say that") are answered from beliefs, the self-model and events, never invented.
|
||||
7. **Language.** The intent is rendered deterministically from templates, or, when a model is configured for the `respond` role, sent to the model with the intent as the thing it must stay grounded in. The reply is a `response_generated` event with its evidence references and the model call, if any.
|
||||
8. **Message back.** The reply is stored in the conversation with links to the event and the model call. The interface shows the reply with an evidence panel; the API returns the same structure.
|
||||
|
||||
## Why the detour matters
|
||||
|
||||
Because the reply is derived from an intent, a mind can say "I have only been told this once" or "I do not know" rather than produce a confident paragraph. Because the message became an observation, the mind remembers the conversation the way it remembers anything else and the memory carries who said it and when. Because prompt text is data, an instruction embedded in a message cannot change policy or trigger a capability; that property has a test corpus behind it.
|
||||
Because the reply is derived from an intent, a mind can say "I have only been told this once" or "I do not know" rather than produce a confident paragraph. Because assertions are kept apart from beliefs, it can be sure that Andy said Steve steals laptops while remaining unsure whether Steve does. Because the message became an observation, the mind remembers the conversation the way it remembers anything else and the memory carries who said it and when. Because prompt text is data, an instruction embedded in a message cannot change policy or trigger a capability; that property has a test corpus behind it.
|
||||
|
||||
## Waiting for a reply
|
||||
|
||||
|
||||
Reference in New Issue
Block a user