superlocalmemory 4.0.4 → 4.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/README.md +18 -13
- package/ide/configs/codex-mcp.toml +2 -2
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/.mcp.json +1 -0
- package/plugin/CLAUDE.md +3 -3
- package/plugin/agents/slm-governance-advisor.md +1 -1
- package/plugin/agents/slm-loop-runner.md +1 -1
- package/plugin/agents/slm-memory-advisor.md +1 -1
- package/plugin/agents/slm-optimize-advisor.md +1 -1
- package/plugin/requirements.txt +1 -1
- package/plugin/skills/slm-cache/SKILL.md +1 -1
- package/plugin/skills/slm-compress/SKILL.md +1 -1
- package/plugin/skills/slm-governance/SKILL.md +1 -1
- package/plugin/skills/slm-graph/SKILL.md +3 -2
- package/plugin/skills/slm-loop/SKILL.md +1 -1
- package/plugin/skills/slm-mesh/SKILL.md +1 -1
- package/plugin/skills/slm-profile/SKILL.md +2 -1
- package/plugin/skills/slm-recall/SKILL.md +1 -1
- package/plugin/skills/slm-remember/SKILL.md +1 -1
- package/plugin/skills/slm-scope/SKILL.md +1 -1
- package/plugin/skills/slm-session/SKILL.md +1 -1
- package/plugin/skills/slm-status/SKILL.md +1 -1
- package/plugin-src/rules/AGENTS.md +6 -5
- package/plugin-src/skills/slm-graph/SKILL.md +2 -1
- package/plugin-src/skills/slm-profile/SKILL.md +1 -0
- package/pyproject.toml +1 -1
- package/src/superlocalmemory/__init__.py +1 -1
- package/src/superlocalmemory/brain/__init__.py +5 -0
- package/src/superlocalmemory/brain/truth.py +348 -0
- package/src/superlocalmemory/cli/commands.py +82 -25
- package/src/superlocalmemory/cli/main.py +12 -0
- package/src/superlocalmemory/core/context_cache.py +58 -1
- package/src/superlocalmemory/core/mutations.py +155 -25
- package/src/superlocalmemory/core/recall_pipeline.py +6 -10
- package/src/superlocalmemory/core/remember_runtime.py +271 -2
- package/src/superlocalmemory/core/store_pipeline.py +100 -38
- package/src/superlocalmemory/encoding/consolidator.py +17 -47
- package/src/superlocalmemory/encoding/temporal_validator.py +14 -18
- package/src/superlocalmemory/hooks/user_prompt_hook.py +1 -1
- package/src/superlocalmemory/integrations/bounded_loops_mcp.py +4 -3
- package/src/superlocalmemory/mcp/profiles.py +19 -7
- package/src/superlocalmemory/mcp/server.py +4 -2
- package/src/superlocalmemory/mcp/tools_brain.py +54 -10
- package/src/superlocalmemory/mcp/tools_core.py +88 -3
- package/src/superlocalmemory/retrieval/engine.py +7 -10
- package/src/superlocalmemory/retrieval/temporal_validity_filter.py +119 -19
- package/src/superlocalmemory/server/routes/brain.py +15 -0
- package/src/superlocalmemory/server/routes/memories.py +129 -3
- package/src/superlocalmemory/storage/_migration_internals.py +4 -0
- package/src/superlocalmemory/storage/_schema_version.py +2 -2
- package/src/superlocalmemory/storage/correction_cases.py +670 -0
- package/src/superlocalmemory/storage/database.py +194 -24
- package/src/superlocalmemory/storage/migration_runner.py +7 -0
- package/src/superlocalmemory/storage/migrations/M042_correction_case_ledger.py +245 -0
- package/src/superlocalmemory/storage/migrations/__init__.py +2 -0
- package/src/superlocalmemory/storage/write_coordinator.py +4 -0
- package/src/superlocalmemory/ui/js/brain.js +43 -7
- package/src/superlocalmemory/ui/js/od-brain.js +44 -28
|
@@ -227,10 +227,23 @@
|
|
|
227
227
|
var healthColor = healthStatus === 'HEALTHY' ? 'var(--ok)'
|
|
228
228
|
: healthStatus === 'ACTIVE' ? 'var(--cyan)' : undefined;
|
|
229
229
|
var pCount = ((beh.patterns) || []).length;
|
|
230
|
-
|
|
230
|
+
// BrainTruth is the portable V4.0.5 source of truth. Legacy sections
|
|
231
|
+
// remain a rolling-upgrade fallback only.
|
|
232
|
+
var truth = (living && living.brain_truth) || {};
|
|
233
|
+
var memoryActivity = truth.memory_activity || {};
|
|
234
|
+
var feedback = truth.feedback || (living && living.feedback) || {};
|
|
235
|
+
var experience = truth.agent_experience || (living && living.agent_experience) || {};
|
|
236
|
+
var externalEvidence = truth.external_evidence || experience.external_graph_evidence || {};
|
|
237
|
+
var correctionQuality = truth.correction_quality || {};
|
|
231
238
|
var graph = (living && living.graph) || {};
|
|
232
|
-
|
|
233
|
-
|
|
239
|
+
|
|
240
|
+
function truthCount(section, key, unit) {
|
|
241
|
+
if (!section || section.availability === 'unavailable') {
|
|
242
|
+
return 'Unavailable' + (section && section.reason ? ': ' + section.reason : '');
|
|
243
|
+
}
|
|
244
|
+
var value = section[key];
|
|
245
|
+
return value == null ? 'No data yet' : String(value) + (unit ? ' ' + unit : '');
|
|
246
|
+
}
|
|
234
247
|
|
|
235
248
|
// KPI strip
|
|
236
249
|
var strip = EL('div', { className: 'kpi-strip', style: 'margin-bottom:16px' });
|
|
@@ -314,13 +327,14 @@
|
|
|
314
327
|
['Models trained', String(stats.models_trained || 0)],
|
|
315
328
|
['Verified active models', String(stats.models_active_verified || 0)],
|
|
316
329
|
['Sources tracked', String(stats.tracked_sources || 0)],
|
|
317
|
-
['
|
|
318
|
-
['
|
|
319
|
-
['Claimed evidence
|
|
320
|
-
['
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
330
|
+
['Memory activity', truthCount(memoryActivity, 'facts_total', 'facts')],
|
|
331
|
+
['Feedback signals', truthCount(feedback, 'signals_total', 'signals')],
|
|
332
|
+
['Claimed evidence', truthCount(experience, 'claimed_experiences_total', 'receipts')],
|
|
333
|
+
['Independently verified evidence', truthCount(
|
|
334
|
+
experience, 'independently_verified_experiences_total', 'receipts',
|
|
335
|
+
)],
|
|
336
|
+
['External observations', truthCount(externalEvidence, 'receipts_total', 'receipts')],
|
|
337
|
+
['Correction quality', truthCount(correctionQuality, 'cases_total', 'review cases')],
|
|
324
338
|
['Graph evidence', String(graph.fact_nodes || 0) + ' nodes · ' +
|
|
325
339
|
String(graph.association_edges || 0) + ' edges'],
|
|
326
340
|
].forEach(function (row) {
|
|
@@ -354,23 +368,25 @@
|
|
|
354
368
|
text: 'SLM records completed work when an integration supplies evidence. These records do not change recall, ranking, or model routing by themselves.',
|
|
355
369
|
}));
|
|
356
370
|
var evGrid = EL('div', { className: 'kpi-strip', style: 'margin:0' });
|
|
357
|
-
evGrid.appendChild(kpiCard('fact_check', '
|
|
358
|
-
|
|
359
|
-
Number(experience.
|
|
360
|
-
evGrid.appendChild(kpiCard('verified', '
|
|
361
|
-
|
|
362
|
-
|
|
371
|
+
evGrid.appendChild(kpiCard('fact_check', 'Claimed evidence',
|
|
372
|
+
truthCount(experience, 'claimed_experiences_total', ''), 'profile-scoped durable receipts',
|
|
373
|
+
Number(experience.claimed_experiences_total || 0) > 0, undefined, true));
|
|
374
|
+
evGrid.appendChild(kpiCard('verified', 'Independently verified evidence',
|
|
375
|
+
truthCount(experience, 'independently_verified_experiences_total', ''),
|
|
376
|
+
experience.verification_availability === 'not_supported_by_read_model'
|
|
377
|
+
? 'not supported by this read model' : 'independent verifier result',
|
|
378
|
+
Number(experience.independently_verified_experiences_total || 0) > 0, undefined, true));
|
|
363
379
|
evGrid.appendChild(kpiCard('account_tree', 'Cognitive turns',
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
Number(experience.
|
|
368
|
-
evGrid.appendChild(kpiCard('account_tree', '
|
|
369
|
-
|
|
370
|
-
externalEvidence.
|
|
371
|
-
?
|
|
372
|
-
: '
|
|
373
|
-
Number(externalEvidence.
|
|
380
|
+
truthCount(experience, 'cognitive_turns_total', ''),
|
|
381
|
+
String((experience.cognitive_turns_by_state || {}).open || 0) + ' open · ' +
|
|
382
|
+
String((experience.cognitive_turns_by_state || {}).finalized || 0) + ' finalized',
|
|
383
|
+
Number(experience.cognitive_turns_total || 0) > 0, undefined, true));
|
|
384
|
+
evGrid.appendChild(kpiCard('account_tree', 'External observations',
|
|
385
|
+
truthCount(externalEvidence, 'receipts_total', ''),
|
|
386
|
+
externalEvidence.availability === 'available'
|
|
387
|
+
? String(externalEvidence.demonstrations_total || 0) + ' demonstrations · no automatic learning'
|
|
388
|
+
: 'external evidence unavailable',
|
|
389
|
+
Number(externalEvidence.receipts_total || 0) > 0, undefined, true));
|
|
374
390
|
evb.appendChild(evGrid);
|
|
375
391
|
evc.appendChild(evb);
|
|
376
392
|
sec.appendChild(evc);
|
|
@@ -854,8 +870,8 @@
|
|
|
854
870
|
var head = EL('div', { className: 'page-head' });
|
|
855
871
|
head.appendChild(EL('h2', { text: 'The living brain' }));
|
|
856
872
|
head.appendChild(EL('p', {
|
|
857
|
-
text: '
|
|
858
|
-
'
|
|
873
|
+
text: 'A local view of memory activity, feedback, and evidence. Observations are shown separately ' +
|
|
874
|
+
'from ranking and do not change recall, ranking, or model routing by themselves.',
|
|
859
875
|
}));
|
|
860
876
|
|
|
861
877
|
container.replaceChildren(
|