Skip to content

Commit 31ef74f

Browse files
committed
Continued the port with the final batch of LUMI mem_* tools plus a BroccoliDB telemetry fix.
New mem_* aliases Tool Backend mem_changelog generate_changelog → Repository.generateChangelog mem_forecast simulate_merge_forecast → repo merge sim + co-change overlap mem_claim / mem_release acquire_lock / release_lock → coordination mutex mem_snapshot Wraps create_cognitive_snapshot with LUMI response format Hermes RPC / graph intelligence generateRepoChangelog() and simulateMergeForecast() in graph_intelligence.ts Six new ops in agent_invoke.ts with cold-path fallbacks in agent_rpc.py BroccoliDB infra fix sovereign_production.test.ts was failing on telemetry flush: telemetry_aggregates upserts now use conflictTarget: 'id' (matches PK) BufferedDbPool upserts now handle increment() values correctly on insert vs. conflict update Verification sovereign_production.test.ts — PASS make verify — 136 tests OK npm run build — clean The LUMI cognitive-memory surface is now largely mirrored in Hermes. Remaining gaps are mostly sub-agent-gated STABILITY_* tools and live joy-zoning prompt injection (intentionally not ported). Say if you want a commit, make distill, or a parity checklist doc.
1 parent a6872cb commit 31ef74f

33 files changed

Lines changed: 3247 additions & 62 deletions

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ verify test-roadmap:
2525
python3 scripts/roadmap_smoke.py
2626
python3 scripts/roadmap_audit.py
2727
python3 scripts/roadmap_operator_smoke.py
28-
python3 -m unittest tests.test_roadmap_checkpoint tests.test_native_mutation -q
28+
python3 -m unittest tests.test_roadmap_checkpoint tests.test_roadmap_tools tests.test_roadmap_external_watch tests.test_project_map_tools tests.test_layer_align tests.test_native_mutation tests.test_mem_tools -q
2929

3030
install:
3131
python3 install.py
Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
{
2+
"timestamp": "2026-06-17T11:20:44.438Z",
3+
"error": "SqliteError: ON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\n at Database.prepare (/Users/bozoegg/Desktop/dietcode-plugin/broccolidb/node_modules/better-sqlite3/lib/methods/wrappers.js:5:21)\n at SqliteConnection.executeQuery (file:///Users/bozoegg/Desktop/dietcode-plugin/broccolidb/node_modules/kysely/dist/esm/dialect/sqlite/sqlite-driver.js:62:31)\n at file:///Users/bozoegg/Desktop/dietcode-plugin/broccolidb/node_modules/kysely/dist/esm/query-executor/query-executor-base.js:35:45\n at #run (file:///Users/bozoegg/Desktop/dietcode-plugin/broccolidb/node_modules/kysely/dist/esm/driver/single-connection-provider.js:24:22)\n at SingleConnectionProvider.provideConnection (file:///Users/bozoegg/Desktop/dietcode-plugin/broccolidb/node_modules/kysely/dist/esm/driver/single-connection-provider.js:16:41)\n at DefaultQueryExecutor.provideConnection (file:///Users/bozoegg/Desktop/dietcode-plugin/broccolidb/node_modules/kysely/dist/esm/query-executor/default-query-executor.js:20:41)\n at DefaultQueryExecutor.executeQuery (file:///Users/bozoegg/Desktop/dietcode-plugin/broccolidb/node_modules/kysely/dist/esm/query-executor/query-executor-base.js:34:27)\n at NotCommittedOrRolledBackAssertingExecutor.executeQuery (file:///Users/bozoegg/Desktop/dietcode-plugin/broccolidb/node_modules/kysely/dist/esm/kysely.js:896:31)\n at InsertQueryBuilder.execute (file:///Users/bozoegg/Desktop/dietcode-plugin/broccolidb/node_modules/kysely/dist/esm/query-builder/insert-query-builder.js:1106:51)\n at BufferedDbPool.executeSingleOp (/Users/bozoegg/Desktop/dietcode-plugin/broccolidb/infrastructure/db/BufferedDbPool.ts:1271:19)",
4+
"ops": [
5+
{
6+
"type": "insert",
7+
"table": "users",
8+
"values": {
9+
"id": "test-user-15",
10+
"createdAt": 1781695244423
11+
},
12+
"layer": "infrastructure",
13+
"seq": 0,
14+
"hasIncrements": false
15+
},
16+
{
17+
"type": "insert",
18+
"table": "workspaces",
19+
"values": {
20+
"id": "test-workspace-15",
21+
"userId": "test-user-15",
22+
"sharedMemoryLayer": "[]",
23+
"createdAt": 1781695244423
24+
},
25+
"layer": "infrastructure",
26+
"seq": 1,
27+
"hasIncrements": false
28+
},
29+
{
30+
"type": "insert",
31+
"table": "nodes",
32+
"values": {
33+
"id": "4e7e49f0-33c0-4db7-aaa8-c1ff83176ee2",
34+
"repoPath": "test-repo",
35+
"parentId": null,
36+
"data": "{\"content\":\"hello\"}",
37+
"message": "commit msg",
38+
"author": "test-agent",
39+
"timestamp": 1781695244435,
40+
"type": "snapshot",
41+
"usage": "{\"promptTokens\":10,\"completionTokens\":20,\"totalTokens\":30,\"totalCost\":0.00018}",
42+
"metadata": "{\"decisionIds\":[],\"environment\":{\"osName\":\"darwin\",\"osVersion\":\"25.2.0\",\"osArch\":\"arm64\",\"hostName\":\"MacBookPro.lan\",\"nodeVersion\":\"v22.22.3\",\"timestamp\":\"2026-06-17T11:20:44.434Z\"}}",
43+
"tree": null
44+
},
45+
"layer": "domain",
46+
"seq": 4,
47+
"agentId": "test-agent",
48+
"hasIncrements": false
49+
},
50+
{
51+
"type": "insert",
52+
"table": "telemetry",
53+
"values": {
54+
"id": "0a1ca4ff-0fc2-4142-9d11-64ad1f47ccb7",
55+
"repoPath": "test-repo",
56+
"agentId": "test-agent",
57+
"taskId": null,
58+
"promptTokens": 10,
59+
"completionTokens": 20,
60+
"totalTokens": 30,
61+
"modelId": "default",
62+
"cost": 0.00018,
63+
"timestamp": 1781695244435,
64+
"environment": "{\"osName\":\"darwin\",\"osVersion\":\"25.2.0\",\"osArch\":\"arm64\",\"hostName\":\"MacBookPro.lan\",\"nodeVersion\":\"v22.22.3\",\"timestamp\":\"2026-06-17T11:20:44.435Z\"}"
65+
},
66+
"layer": "infrastructure",
67+
"seq": 6,
68+
"hasIncrements": false
69+
},
70+
{
71+
"type": "insert",
72+
"table": "reflog",
73+
"values": {
74+
"id": "74dfc061-9af2-44fc-8692-3b7787f35e3c",
75+
"ref": "main",
76+
"oldHead": null,
77+
"newHead": "4e7e49f0-33c0-4db7-aaa8-c1ff83176ee2",
78+
"author": "test-agent",
79+
"message": "commit msg",
80+
"timestamp": 1781695244435,
81+
"operation": "commit",
82+
"repoPath": "test-repo"
83+
},
84+
"layer": "infrastructure",
85+
"seq": 7,
86+
"hasIncrements": false
87+
},
88+
{
89+
"type": "insert",
90+
"table": "swarm_locks",
91+
"values": {
92+
"resource": "production_resource",
93+
"ownerId": "20144",
94+
"expiresAt": 1781695304424,
95+
"createdAt": 1781695244424
96+
},
97+
"seq": 2,
98+
"hasIncrements": false
99+
},
100+
{
101+
"type": "upsert",
102+
"table": "branches",
103+
"where": [
104+
{
105+
"column": "repoPath",
106+
"value": "test-repo"
107+
},
108+
{
109+
"column": "name",
110+
"value": "main"
111+
}
112+
],
113+
"values": {
114+
"repoPath": "test-repo",
115+
"name": "main",
116+
"head": "",
117+
"createdAt": 1781695244433,
118+
"isEphemeral": 0,
119+
"expiresAt": null
120+
},
121+
"layer": "domain",
122+
"seq": 3,
123+
"hasIncrements": false
124+
},
125+
{
126+
"type": "upsert",
127+
"table": "telemetry_aggregates",
128+
"where": [
129+
{
130+
"column": "repoPath",
131+
"value": "test-repo"
132+
},
133+
{
134+
"column": "id",
135+
"value": "global"
136+
}
137+
],
138+
"values": {
139+
"repoPath": "test-repo",
140+
"id": "global",
141+
"totalCommits": {
142+
"_type": "increment",
143+
"value": 1
144+
},
145+
"totalTokens": {
146+
"_type": "increment",
147+
"value": 30
148+
},
149+
"totalCost": {
150+
"_type": "increment",
151+
"value": 0.00018
152+
}
153+
},
154+
"layer": "infrastructure",
155+
"seq": 8,
156+
"hasIncrements": true
157+
},
158+
{
159+
"type": "upsert",
160+
"table": "telemetry_aggregates",
161+
"where": [
162+
{
163+
"column": "repoPath",
164+
"value": "test-repo"
165+
},
166+
{
167+
"column": "id",
168+
"value": "agent_test-agent"
169+
}
170+
],
171+
"values": {
172+
"repoPath": "test-repo",
173+
"id": "agent_test-agent",
174+
"totalCommits": {
175+
"_type": "increment",
176+
"value": 1
177+
},
178+
"totalTokens": {
179+
"_type": "increment",
180+
"value": 30
181+
},
182+
"totalCost": {
183+
"_type": "increment",
184+
"value": 0.00018
185+
}
186+
},
187+
"layer": "infrastructure",
188+
"seq": 9,
189+
"hasIncrements": true
190+
},
191+
{
192+
"type": "update",
193+
"where": [
194+
{
195+
"column": "repoPath",
196+
"value": "test-repo"
197+
},
198+
{
199+
"column": "name",
200+
"value": "main"
201+
}
202+
],
203+
"table": "branches",
204+
"values": {
205+
"head": "4e7e49f0-33c0-4db7-aaa8-c1ff83176ee2"
206+
},
207+
"layer": "domain",
208+
"seq": 5,
209+
"agentId": "test-agent",
210+
"hasIncrements": false
211+
}
212+
]
213+
}

0 commit comments

Comments
 (0)