feat(graph): association is not causation
Adds co_occurs_with, temporally_precedes, possibly_caused_by and asserted_by to the relation vocabulary with Causal and Hypothetical predicates. Entities mentioned together now co-occur rather than being 'related'; association hypotheses record possibly_caused_by and their basis (temporal association only); caused_by is reserved for explicit operator statements and nothing automatic writes it. Documented in docs/graph.md and checked end to end.
This commit is contained in:
@@ -45,10 +45,12 @@ func (h Handlers) linkEntities(ctx context.Context, c *brain.Cycle, names []stri
|
||||
add("", n)
|
||||
}
|
||||
}
|
||||
// The speaker discussed each entity; mentioned entities relate to each other.
|
||||
// The speaker discussed each entity; entities mentioned together merely
|
||||
// co-occur. Co-occurrence is association, never a causal or structural
|
||||
// claim; stronger relations need an explicit statement or an operator.
|
||||
for i := range ents {
|
||||
for j := i + 1; j < len(ents); j++ {
|
||||
rel := concepts.RelatedTo
|
||||
rel := concepts.CoOccursWith
|
||||
if ents[i].Kind == graph.Person && i == 0 && actor != "" {
|
||||
rel = concepts.DiscussedWith
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ func (h Handlers) hypothesis(ctx context.Context, c *brain.Cycle, t workspace.Th
|
||||
}
|
||||
res, err := h.Beliefs.Create(ctx, c.Tx, emitter(c), beliefs.New{MindID: c.State.Mind.ID, Proposition: prop, Epistemic: concepts.Hypothesis, Source: "brain.associate",
|
||||
Evidence: ev, Alternatives: []string{"coincidence: the two events are unrelated", "a third factor caused both"}, OriginEvent: t.EventID, Causation: t.EventID, Correlation: c.State.CycleID,
|
||||
Detail: map[string]any{"cause_event": t.Content["cause_event"], "effect_event": t.Content["effect_event"], "gap_seconds": t.Content["gap_seconds"]}})
|
||||
Detail: map[string]any{"cause_event": t.Content["cause_event"], "effect_event": t.Content["effect_event"], "gap_seconds": t.Content["gap_seconds"], "relation": string(concepts.PossiblyCausedBy), "basis": "temporal association only"}})
|
||||
if err != nil {
|
||||
if errors.Is(err, beliefs.ErrBlocked) {
|
||||
c.Emit(events.New{Type: events.Metacognition, Source: "brain.executive", Summary: "hypothesis blocked by operator correction: " + prop, Salience: 0.3, Confidence: 1, Metadata: map[string]any{"check": "do_not_infer"}})
|
||||
|
||||
Reference in New Issue
Block a user