Skip to content

Commit a416c42

Browse files
Ashish-dwi99claude
andcommitted
v3.2.0: Event-sourced belief ledger with influence tracing
Move beliefs from per-file JSON to SQLite with append-only events, materialized projections, 4 independent status axes, correction chains, and first-class influence tracing across context/search/outcome paths. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c556ba9 commit a416c42

9 files changed

Lines changed: 2245 additions & 312 deletions

File tree

CHANGELOG.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,72 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/), and this project adheres to [Semantic Versioning](https://semver.org/).
66

7+
## [3.2.0] - 2026-04-06 — Event-Sourced Belief Ledger
8+
9+
Dhee's belief system moves from per-file JSON to a fully event-sourced SQLite model with influence tracing.
10+
11+
### Architecture
12+
13+
- **Append-only belief events** — Every mutation (proposed, reinforced, challenged, corrected, marked_stale, tombstoned, merged, split, pinned, unpinned, archived, revived) is recorded as an immutable event with before/after state snapshots.
14+
- **Materialized belief_nodes** — Current belief state maintained as a projection, updated atomically in the same transaction as the event INSERT.
15+
- **Persistent connection** — Single SQLite connection with WAL mode, opened once. Replaces per-call connection creation.
16+
- **Cache loaded once** — In-memory cache hydrated on init, maintained by mutations. No reload-on-every-read overhead.
17+
18+
### New Tables
19+
20+
- `belief_nodes` — Materialized current state with 4 independent status axes
21+
- `belief_events` — Immutable append-only event log (source of truth) with CHECK constraint on event types
22+
- `belief_evidence` — Evidence edges linking beliefs to memories and episodes
23+
- `belief_relations` — Inter-belief edges (contradicts, supersedes, merged_into, split_from)
24+
- `belief_influence_events` — Tracks which beliefs were considered, included, or grounded during context/search/answer assembly
25+
26+
### Status Axes (replaces single status enum)
27+
28+
- `truth_status` — proposed / held / challenged / revised / retracted
29+
- `freshness_status` — current / stale / superseded
30+
- `lifecycle_status` — active / archived / tombstoned
31+
- `protection_level` — normal / pinned
32+
33+
### Correction Chains
34+
35+
- `correct_belief()` creates a successor belief, marks the old one as superseded
36+
- Superseded beliefs are hidden from `get_beliefs()` and `get_relevant_beliefs()` by default
37+
- Full successor chain tracked via `belief_relations` with type `supersedes`
38+
39+
### Belief Influence Tracing (Cut 2)
40+
41+
Six instrumentation points record which beliefs were considered/used:
42+
- `included` — belief returned in HyperContext during `context()`
43+
- `contradiction_surfaced` — contradiction pair shown as warning
44+
- `considered` — belief retrieved during learning outcome recording
45+
- `grounded` — belief influenced policy decay or was reinforced/challenged from outcomes
46+
- `activated` — user explicitly added or challenged a belief
47+
48+
### New Operations
49+
50+
- `correct_belief(id, new_claim, reason)` — correction with successor chain
51+
- `mark_stale(id, reason)` — mark belief as stale
52+
- `tombstone_belief(id, reason)` — soft-delete
53+
- `pin_belief(id)` / `unpin_belief(id)` — protection level management
54+
- `merge_beliefs(survivor_id, loser_id)` — merge with evidence copying
55+
- `get_belief_history(id)` — full event log for a belief
56+
- `get_belief_evidence(id)` — evidence chain
57+
- `record_influence()` / `get_influence_history()` / `get_influence_stats()` — influence tracking
58+
- `query_beliefs()` — paginated, multi-axis filtered search
59+
- `list_activity()` — combined belief + influence event timeline
60+
61+
### Migration
62+
63+
- Automatic JSON-to-SQLite migration on first run with receipt tracking
64+
- Legacy JSON files backed up to `legacy_json_backup/` directory
65+
- Idempotent — safe to run multiple times
66+
67+
### Bug Fixes
68+
69+
- Superseded beliefs no longer leak through `get_beliefs()` and `get_relevant_beliefs()`
70+
- `correct_belief()` runs in a single transaction (was 3 connections, 8+ queries)
71+
- `status` field unified as property alias for `truth_status` (eliminates dual-field divergence)
72+
773
## [3.0.0] - 2026-04-01 — Event-Sourced Cognition Substrate
874

975
Dhee v3 is a ground-up architectural overhaul that transforms the memory layer into an immutable-event, versioned cognition substrate. Raw memory is now immutable truth; derived cognition (beliefs, policies, insights, heuristics) is provisional, rebuildable, and auditable.

dhee/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
# Default: CoreMemory (lightest, zero-config)
3333
Memory = CoreMemory
3434

35-
__version__ = "3.1.0"
35+
__version__ = "3.2.0"
3636
__all__ = [
3737
# Memory classes
3838
"Engram",

0 commit comments

Comments
 (0)