superlocalmemory 4.1.13 → 4.1.14
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/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +48 -0
- package/README.md +3 -3
- package/package.json +1 -8
- package/plugin/.claude-plugin/plugin.json +1 -1
- 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 +1 -1
- 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 +1 -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/agents/slm-memory-advisor.md +1 -1
- package/plugin-src/agents/slm-optimize-advisor.md +1 -1
- package/plugin-src/rules/AGENTS.md +1 -1
- package/plugin-src/skills/slm-cache/SKILL.md +1 -1
- package/plugin-src/skills/slm-compress/SKILL.md +1 -1
- package/plugin-src/skills/slm-governance/SKILL.md +1 -1
- package/plugin-src/skills/slm-graph/SKILL.md +1 -1
- package/plugin-src/skills/slm-loop/SKILL.md +1 -1
- package/plugin-src/skills/slm-mesh/SKILL.md +1 -1
- package/plugin-src/skills/slm-profile/SKILL.md +1 -1
- package/plugin-src/skills/slm-recall/SKILL.md +1 -1
- package/plugin-src/skills/slm-remember/SKILL.md +1 -1
- package/plugin-src/skills/slm-scope/SKILL.md +1 -1
- package/plugin-src/skills/slm-session/SKILL.md +1 -1
- package/plugin-src/skills/slm-status/SKILL.md +1 -1
- package/scripts/postinstall.js +71 -2
- package/pyproject.toml +0 -250
- package/src/superlocalmemory/__init__.py +0 -82
- package/src/superlocalmemory/access/__init__.py +0 -3
- package/src/superlocalmemory/access/rbac.py +0 -575
- package/src/superlocalmemory/attribution/__init__.py +0 -9
- package/src/superlocalmemory/attribution/signer.py +0 -173
- package/src/superlocalmemory/attribution/watermark.py +0 -189
- package/src/superlocalmemory/brain/__init__.py +0 -5
- package/src/superlocalmemory/brain/truth.py +0 -418
- package/src/superlocalmemory/cli/__init__.py +0 -5
- package/src/superlocalmemory/cli/__main__.py +0 -17
- package/src/superlocalmemory/cli/_lazy_init.py +0 -115
- package/src/superlocalmemory/cli/cache_cmd.py +0 -198
- package/src/superlocalmemory/cli/commands.py +0 -4710
- package/src/superlocalmemory/cli/compress_cmd.py +0 -151
- package/src/superlocalmemory/cli/context_commands.py +0 -193
- package/src/superlocalmemory/cli/daemon.py +0 -909
- package/src/superlocalmemory/cli/db_migrate.py +0 -150
- package/src/superlocalmemory/cli/diagnostics_cmd.py +0 -101
- package/src/superlocalmemory/cli/escape_hatch.py +0 -220
- package/src/superlocalmemory/cli/evidence_cmd.py +0 -103
- package/src/superlocalmemory/cli/gdpr_cmd.py +0 -792
- package/src/superlocalmemory/cli/gdpr_io.py +0 -109
- package/src/superlocalmemory/cli/help_cmd.py +0 -197
- package/src/superlocalmemory/cli/host_upgrades.py +0 -189
- package/src/superlocalmemory/cli/ingest_cmd.py +0 -327
- package/src/superlocalmemory/cli/json_output.py +0 -81
- package/src/superlocalmemory/cli/loop_cmd.py +0 -187
- package/src/superlocalmemory/cli/main.py +0 -1145
- package/src/superlocalmemory/cli/mesh_cmd.py +0 -38
- package/src/superlocalmemory/cli/migrate_cmd.py +0 -55
- package/src/superlocalmemory/cli/ops_cmd.py +0 -281
- package/src/superlocalmemory/cli/optimize_cmd.py +0 -179
- package/src/superlocalmemory/cli/optimize_constants.py +0 -31
- package/src/superlocalmemory/cli/pending_store.py +0 -296
- package/src/superlocalmemory/cli/proxy_cmd.py +0 -108
- package/src/superlocalmemory/cli/scale_engine_cmd.py +0 -56
- package/src/superlocalmemory/cli/service_installer.py +0 -373
- package/src/superlocalmemory/cli/setup_wizard.py +0 -1162
- package/src/superlocalmemory/cli/summary_cmd.py +0 -215
- package/src/superlocalmemory/cli/version_banner.py +0 -202
- package/src/superlocalmemory/cli/wizard_v3426_options.py +0 -129
- package/src/superlocalmemory/code_graph/__init__.py +0 -46
- package/src/superlocalmemory/code_graph/blast_radius.py +0 -177
- package/src/superlocalmemory/code_graph/bridge/__init__.py +0 -36
- package/src/superlocalmemory/code_graph/bridge/entity_resolver.py +0 -490
- package/src/superlocalmemory/code_graph/bridge/event_listeners.py +0 -206
- package/src/superlocalmemory/code_graph/bridge/fact_enricher.py +0 -159
- package/src/superlocalmemory/code_graph/bridge/hebbian_linker.py +0 -170
- package/src/superlocalmemory/code_graph/bridge/maintenance.py +0 -220
- package/src/superlocalmemory/code_graph/bridge/temporal_checker.py +0 -152
- package/src/superlocalmemory/code_graph/changes.py +0 -363
- package/src/superlocalmemory/code_graph/communities.py +0 -299
- package/src/superlocalmemory/code_graph/config.py +0 -154
- package/src/superlocalmemory/code_graph/database.py +0 -526
- package/src/superlocalmemory/code_graph/extractors/__init__.py +0 -95
- package/src/superlocalmemory/code_graph/extractors/python.py +0 -413
- package/src/superlocalmemory/code_graph/extractors/typescript.py +0 -556
- package/src/superlocalmemory/code_graph/flows.py +0 -350
- package/src/superlocalmemory/code_graph/git_hooks.py +0 -226
- package/src/superlocalmemory/code_graph/graph_engine.py +0 -295
- package/src/superlocalmemory/code_graph/graph_store.py +0 -335
- package/src/superlocalmemory/code_graph/incremental.py +0 -200
- package/src/superlocalmemory/code_graph/models.py +0 -130
- package/src/superlocalmemory/code_graph/parser.py +0 -687
- package/src/superlocalmemory/code_graph/resolver.py +0 -321
- package/src/superlocalmemory/code_graph/search.py +0 -460
- package/src/superlocalmemory/code_graph/service.py +0 -95
- package/src/superlocalmemory/code_graph/watcher.py +0 -207
- package/src/superlocalmemory/compliance/__init__.py +0 -0
- package/src/superlocalmemory/compliance/abac.py +0 -204
- package/src/superlocalmemory/compliance/audit.py +0 -385
- package/src/superlocalmemory/compliance/eu_ai_act.py +0 -101
- package/src/superlocalmemory/compliance/gdpr.py +0 -1479
- package/src/superlocalmemory/compliance/lifecycle.py +0 -158
- package/src/superlocalmemory/compliance/retention.py +0 -415
- package/src/superlocalmemory/compliance/scheduler.py +0 -217
- package/src/superlocalmemory/contracts/__init__.py +0 -1
- package/src/superlocalmemory/contracts/schemas/agent-experience-v1.schema.json +0 -92
- package/src/superlocalmemory/contracts/schemas/agent-integration-contract-v2.schema.json +0 -46
- package/src/superlocalmemory/contracts/schemas/cognitive-turn-receipt-v1.schema.json +0 -59
- package/src/superlocalmemory/contracts/v402.py +0 -62
- package/src/superlocalmemory/core/__init__.py +0 -0
- package/src/superlocalmemory/core/actor_context.py +0 -166
- package/src/superlocalmemory/core/admission.py +0 -769
- package/src/superlocalmemory/core/backend_orchestrator.py +0 -637
- package/src/superlocalmemory/core/block_hygiene.py +0 -147
- package/src/superlocalmemory/core/community_summary.py +0 -267
- package/src/superlocalmemory/core/component_healer.py +0 -144
- package/src/superlocalmemory/core/component_registry.py +0 -514
- package/src/superlocalmemory/core/config.py +0 -2204
- package/src/superlocalmemory/core/consolidation_engine.py +0 -983
- package/src/superlocalmemory/core/context_cache.py +0 -574
- package/src/superlocalmemory/core/derivation_lineage.py +0 -246
- package/src/superlocalmemory/core/embedding_worker.py +0 -208
- package/src/superlocalmemory/core/embeddings.py +0 -1052
- package/src/superlocalmemory/core/engine.py +0 -1395
- package/src/superlocalmemory/core/engine_capabilities.py +0 -24
- package/src/superlocalmemory/core/engine_ingestion.py +0 -983
- package/src/superlocalmemory/core/engine_lock.py +0 -75
- package/src/superlocalmemory/core/engine_wiring.py +0 -776
- package/src/superlocalmemory/core/entity_community.py +0 -178
- package/src/superlocalmemory/core/error_envelope.py +0 -60
- package/src/superlocalmemory/core/evidence_bundle.py +0 -528
- package/src/superlocalmemory/core/fact_consolidator.py +0 -812
- package/src/superlocalmemory/core/file_lock.py +0 -92
- package/src/superlocalmemory/core/graph_analyzer.py +0 -456
- package/src/superlocalmemory/core/graph_metrics.py +0 -597
- package/src/superlocalmemory/core/graph_pruner.py +0 -939
- package/src/superlocalmemory/core/health_monitor.py +0 -338
- package/src/superlocalmemory/core/hooks.py +0 -65
- package/src/superlocalmemory/core/ingest_gate.py +0 -133
- package/src/superlocalmemory/core/ingest_policy.py +0 -38
- package/src/superlocalmemory/core/ingestion_command.py +0 -1042
- package/src/superlocalmemory/core/injection.py +0 -434
- package/src/superlocalmemory/core/install_detector.py +0 -131
- package/src/superlocalmemory/core/key_expander.py +0 -138
- package/src/superlocalmemory/core/lifecycle_state.py +0 -153
- package/src/superlocalmemory/core/maintenance.py +0 -777
- package/src/superlocalmemory/core/maintenance_scheduler.py +0 -507
- package/src/superlocalmemory/core/materialization_control.py +0 -20
- package/src/superlocalmemory/core/mcp_embedder_proxy.py +0 -89
- package/src/superlocalmemory/core/memory_health.py +0 -266
- package/src/superlocalmemory/core/mode_capability.py +0 -111
- package/src/superlocalmemory/core/modes.py +0 -168
- package/src/superlocalmemory/core/mutations.py +0 -688
- package/src/superlocalmemory/core/ollama_embedder.py +0 -266
- package/src/superlocalmemory/core/ollama_validator.py +0 -315
- package/src/superlocalmemory/core/operation_policy.py +0 -92
- package/src/superlocalmemory/core/operation_policy_registry.py +0 -542
- package/src/superlocalmemory/core/operation_request.py +0 -127
- package/src/superlocalmemory/core/ops_remediation.py +0 -542
- package/src/superlocalmemory/core/pii.py +0 -105
- package/src/superlocalmemory/core/platform_utils.py +0 -138
- package/src/superlocalmemory/core/profiles.py +0 -234
- package/src/superlocalmemory/core/progressive_abstraction.py +0 -208
- package/src/superlocalmemory/core/projection_drain.py +0 -380
- package/src/superlocalmemory/core/queue_consumer.py +0 -168
- package/src/superlocalmemory/core/ram_lock.py +0 -160
- package/src/superlocalmemory/core/rate_limit.py +0 -151
- package/src/superlocalmemory/core/recall_gate.py +0 -95
- package/src/superlocalmemory/core/recall_pipeline.py +0 -1337
- package/src/superlocalmemory/core/recall_queue.py +0 -377
- package/src/superlocalmemory/core/recall_worker.py +0 -414
- package/src/superlocalmemory/core/registry.py +0 -121
- package/src/superlocalmemory/core/remember_admission.py +0 -161
- package/src/superlocalmemory/core/remember_runtime.py +0 -1190
- package/src/superlocalmemory/core/remote_mode.py +0 -214
- package/src/superlocalmemory/core/reranker_worker.py +0 -338
- package/src/superlocalmemory/core/safe_fs.py +0 -108
- package/src/superlocalmemory/core/scale_autopromote.py +0 -196
- package/src/superlocalmemory/core/scale_engine.py +0 -915
- package/src/superlocalmemory/core/score_contract.py +0 -82
- package/src/superlocalmemory/core/security_primitives.py +0 -672
- package/src/superlocalmemory/core/session_identity.py +0 -98
- package/src/superlocalmemory/core/shadow_router.py +0 -319
- package/src/superlocalmemory/core/slm_disabled.py +0 -85
- package/src/superlocalmemory/core/status_contract.py +0 -108
- package/src/superlocalmemory/core/store_pipeline.py +0 -1404
- package/src/superlocalmemory/core/summarizer.py +0 -200
- package/src/superlocalmemory/core/tier_manager.py +0 -461
- package/src/superlocalmemory/core/topic_signature.py +0 -156
- package/src/superlocalmemory/core/transactions/__init__.py +0 -78
- package/src/superlocalmemory/core/transactions/concrete_owners.py +0 -604
- package/src/superlocalmemory/core/transactions/erasure.py +0 -825
- package/src/superlocalmemory/core/transactions/manifest.py +0 -255
- package/src/superlocalmemory/core/transactions/manifest_key.py +0 -155
- package/src/superlocalmemory/core/transactions/obligations.py +0 -272
- package/src/superlocalmemory/core/transactions/owners.py +0 -114
- package/src/superlocalmemory/core/transactions/reconciler.py +0 -285
- package/src/superlocalmemory/core/transactions/service.py +0 -330
- package/src/superlocalmemory/core/worker_pool.py +0 -377
- package/src/superlocalmemory/core/working_memory.py +0 -288
- package/src/superlocalmemory/dynamics/__init__.py +0 -0
- package/src/superlocalmemory/dynamics/activation_guided_quantization.py +0 -374
- package/src/superlocalmemory/dynamics/eap_scheduler.py +0 -294
- package/src/superlocalmemory/dynamics/ebbinghaus_langevin_coupling.py +0 -171
- package/src/superlocalmemory/dynamics/fisher_langevin_coupling.py +0 -227
- package/src/superlocalmemory/encoding/__init__.py +0 -0
- package/src/superlocalmemory/encoding/auto_linker.py +0 -308
- package/src/superlocalmemory/encoding/cognitive_consolidator.py +0 -899
- package/src/superlocalmemory/encoding/consolidator.py +0 -472
- package/src/superlocalmemory/encoding/context_generator.py +0 -175
- package/src/superlocalmemory/encoding/emotional.py +0 -189
- package/src/superlocalmemory/encoding/entity_reflexion.py +0 -200
- package/src/superlocalmemory/encoding/entity_resolver.py +0 -687
- package/src/superlocalmemory/encoding/entropy_gate.py +0 -101
- package/src/superlocalmemory/encoding/fact_extractor.py +0 -877
- package/src/superlocalmemory/encoding/foresight.py +0 -93
- package/src/superlocalmemory/encoding/graph_builder.py +0 -346
- package/src/superlocalmemory/encoding/observation_builder.py +0 -177
- package/src/superlocalmemory/encoding/prospective_markers.py +0 -262
- package/src/superlocalmemory/encoding/scene_builder.py +0 -410
- package/src/superlocalmemory/encoding/signal_inference.py +0 -90
- package/src/superlocalmemory/encoding/temporal_parser.py +0 -432
- package/src/superlocalmemory/encoding/temporal_validator.py +0 -572
- package/src/superlocalmemory/encoding/type_router.py +0 -237
- package/src/superlocalmemory/evaluation/__init__.py +0 -13
- package/src/superlocalmemory/evaluation/calibration.py +0 -308
- package/src/superlocalmemory/evolution/__init__.py +0 -29
- package/src/superlocalmemory/evolution/blind_verifier.py +0 -122
- package/src/superlocalmemory/evolution/budget.py +0 -356
- package/src/superlocalmemory/evolution/evolution_store.py +0 -619
- package/src/superlocalmemory/evolution/llm_dispatch.py +0 -559
- package/src/superlocalmemory/evolution/model_selection.py +0 -175
- package/src/superlocalmemory/evolution/mutation_generator.py +0 -226
- package/src/superlocalmemory/evolution/skill_activator.py +0 -270
- package/src/superlocalmemory/evolution/skill_evolver.py +0 -928
- package/src/superlocalmemory/evolution/triggers.py +0 -376
- package/src/superlocalmemory/evolution/types.py +0 -114
- package/src/superlocalmemory/graph/__init__.py +0 -9
- package/src/superlocalmemory/graph/cozo_adjacency.py +0 -122
- package/src/superlocalmemory/graph/cozo_backend.py +0 -751
- package/src/superlocalmemory/hooks/__init__.py +0 -3
- package/src/superlocalmemory/hooks/_outcome_common.py +0 -523
- package/src/superlocalmemory/hooks/adapter_base.py +0 -347
- package/src/superlocalmemory/hooks/antigravity_adapter.py +0 -171
- package/src/superlocalmemory/hooks/auto_capture.py +0 -133
- package/src/superlocalmemory/hooks/auto_invoker.py +0 -521
- package/src/superlocalmemory/hooks/auto_parameterize.py +0 -147
- package/src/superlocalmemory/hooks/auto_recall.py +0 -191
- package/src/superlocalmemory/hooks/auto_recall_hook.py +0 -251
- package/src/superlocalmemory/hooks/before_web_hook.py +0 -131
- package/src/superlocalmemory/hooks/claude_code_hooks.py +0 -637
- package/src/superlocalmemory/hooks/codex_assets.py +0 -251
- package/src/superlocalmemory/hooks/codex_hooks.py +0 -186
- package/src/superlocalmemory/hooks/context_payload.py +0 -311
- package/src/superlocalmemory/hooks/copilot_adapter.py +0 -208
- package/src/superlocalmemory/hooks/cross_platform_connector.py +0 -90
- package/src/superlocalmemory/hooks/cursor_adapter.py +0 -173
- package/src/superlocalmemory/hooks/hook_daemon.py +0 -295
- package/src/superlocalmemory/hooks/hook_handlers.py +0 -822
- package/src/superlocalmemory/hooks/ide_connector.py +0 -246
- package/src/superlocalmemory/hooks/memory_protocol.py +0 -158
- package/src/superlocalmemory/hooks/portable_kit.py +0 -755
- package/src/superlocalmemory/hooks/post_tool_async_hook.py +0 -183
- package/src/superlocalmemory/hooks/post_tool_outcome_hook.py +0 -351
- package/src/superlocalmemory/hooks/prewarm_auth.py +0 -187
- package/src/superlocalmemory/hooks/rules_engine.py +0 -99
- package/src/superlocalmemory/hooks/session_registry.py +0 -330
- package/src/superlocalmemory/hooks/stop_outcome_hook.py +0 -138
- package/src/superlocalmemory/hooks/sync_loop.py +0 -114
- package/src/superlocalmemory/hooks/topic_shift_hook.py +0 -302
- package/src/superlocalmemory/hooks/user_prompt_hook.py +0 -131
- package/src/superlocalmemory/hooks/user_prompt_rehash_hook.py +0 -210
- package/src/superlocalmemory/infra/__init__.py +0 -3
- package/src/superlocalmemory/infra/auth_middleware.py +0 -145
- package/src/superlocalmemory/infra/backup.py +0 -974
- package/src/superlocalmemory/infra/backup_obligations.py +0 -423
- package/src/superlocalmemory/infra/cache_manager.py +0 -267
- package/src/superlocalmemory/infra/cloud_backup.py +0 -788
- package/src/superlocalmemory/infra/daemon_identity.py +0 -300
- package/src/superlocalmemory/infra/data_root.py +0 -238
- package/src/superlocalmemory/infra/event_bus.py +0 -637
- package/src/superlocalmemory/infra/local_diagnostics.py +0 -327
- package/src/superlocalmemory/infra/pid_manager.py +0 -193
- package/src/superlocalmemory/infra/process_identity.py +0 -180
- package/src/superlocalmemory/infra/process_reaper.py +0 -624
- package/src/superlocalmemory/infra/rate_limiter.py +0 -228
- package/src/superlocalmemory/infra/self_heal.py +0 -401
- package/src/superlocalmemory/infra/version_integrity.py +0 -229
- package/src/superlocalmemory/ingestion/__init__.py +0 -13
- package/src/superlocalmemory/ingestion/adapter_manager.py +0 -255
- package/src/superlocalmemory/ingestion/base_adapter.py +0 -171
- package/src/superlocalmemory/ingestion/calendar_adapter.py +0 -349
- package/src/superlocalmemory/ingestion/credentials.py +0 -125
- package/src/superlocalmemory/ingestion/gmail_adapter.py +0 -378
- package/src/superlocalmemory/ingestion/parsers.py +0 -100
- package/src/superlocalmemory/ingestion/transcript_adapter.py +0 -161
- package/src/superlocalmemory/integrations/__init__.py +0 -1
- package/src/superlocalmemory/integrations/bounded_loops_mcp.py +0 -431
- package/src/superlocalmemory/integrations/bounded_loops_v051.py +0 -236
- package/src/superlocalmemory/learning/__init__.py +0 -0
- package/src/superlocalmemory/learning/adaptive.py +0 -172
- package/src/superlocalmemory/learning/arm_catalog.py +0 -97
- package/src/superlocalmemory/learning/assertion_miner.py +0 -403
- package/src/superlocalmemory/learning/bandit.py +0 -654
- package/src/superlocalmemory/learning/bandit_cache.py +0 -131
- package/src/superlocalmemory/learning/behavioral.py +0 -542
- package/src/superlocalmemory/learning/bootstrap.py +0 -298
- package/src/superlocalmemory/learning/consolidation_cycle.py +0 -398
- package/src/superlocalmemory/learning/consolidation_quantization_worker.py +0 -115
- package/src/superlocalmemory/learning/consolidation_worker.py +0 -261
- package/src/superlocalmemory/learning/cross_project.py +0 -408
- package/src/superlocalmemory/learning/database.py +0 -698
- package/src/superlocalmemory/learning/dedup_hnsw.py +0 -413
- package/src/superlocalmemory/learning/engagement.py +0 -487
- package/src/superlocalmemory/learning/engagement_features.py +0 -279
- package/src/superlocalmemory/learning/ensemble.py +0 -309
- package/src/superlocalmemory/learning/entity_compiler.py +0 -356
- package/src/superlocalmemory/learning/fact_outcome_joins.py +0 -207
- package/src/superlocalmemory/learning/features.py +0 -138
- package/src/superlocalmemory/learning/feedback.py +0 -724
- package/src/superlocalmemory/learning/forgetting_scheduler.py +0 -375
- package/src/superlocalmemory/learning/hnsw_dedup.py +0 -69
- package/src/superlocalmemory/learning/labeler.py +0 -85
- package/src/superlocalmemory/learning/legacy_migration.py +0 -316
- package/src/superlocalmemory/learning/lightgbm_subprocess.py +0 -236
- package/src/superlocalmemory/learning/memory_merge.py +0 -175
- package/src/superlocalmemory/learning/model_cache.py +0 -267
- package/src/superlocalmemory/learning/model_rollback.py +0 -281
- package/src/superlocalmemory/learning/outcome_queue.py +0 -306
- package/src/superlocalmemory/learning/outcomes.py +0 -286
- package/src/superlocalmemory/learning/pattern_miner.py +0 -465
- package/src/superlocalmemory/learning/pattern_miner_constants.py +0 -90
- package/src/superlocalmemory/learning/pcos.py +0 -291
- package/src/superlocalmemory/learning/project_context.py +0 -366
- package/src/superlocalmemory/learning/propensity.py +0 -131
- package/src/superlocalmemory/learning/ranker.py +0 -300
- package/src/superlocalmemory/learning/ranker_common.py +0 -163
- package/src/superlocalmemory/learning/ranker_retrain_legacy.py +0 -210
- package/src/superlocalmemory/learning/ranker_retrain_online.py +0 -423
- package/src/superlocalmemory/learning/reward.py +0 -888
- package/src/superlocalmemory/learning/reward_archive.py +0 -223
- package/src/superlocalmemory/learning/reward_boost.py +0 -211
- package/src/superlocalmemory/learning/reward_from_outcomes.py +0 -365
- package/src/superlocalmemory/learning/reward_model.py +0 -144
- package/src/superlocalmemory/learning/reward_proxy.py +0 -578
- package/src/superlocalmemory/learning/shadow_test.py +0 -524
- package/src/superlocalmemory/learning/signal_kinds.py +0 -79
- package/src/superlocalmemory/learning/signal_worker.py +0 -268
- package/src/superlocalmemory/learning/signals.py +0 -646
- package/src/superlocalmemory/learning/skill_performance_miner.py +0 -422
- package/src/superlocalmemory/learning/source_quality.py +0 -828
- package/src/superlocalmemory/learning/trigram_index.py +0 -548
- package/src/superlocalmemory/learning/workflows.py +0 -309
- package/src/superlocalmemory/llm/__init__.py +0 -0
- package/src/superlocalmemory/llm/backbone.py +0 -364
- package/src/superlocalmemory/loops/__init__.py +0 -58
- package/src/superlocalmemory/loops/budget.py +0 -58
- package/src/superlocalmemory/loops/engine.py +0 -174
- package/src/superlocalmemory/loops/ledger.py +0 -298
- package/src/superlocalmemory/loops/models.py +0 -152
- package/src/superlocalmemory/loops/rules.py +0 -52
- package/src/superlocalmemory/math/__init__.py +0 -0
- package/src/superlocalmemory/math/ebbinghaus.py +0 -352
- package/src/superlocalmemory/math/fisher.py +0 -356
- package/src/superlocalmemory/math/fisher_quantized.py +0 -255
- package/src/superlocalmemory/math/hopfield.py +0 -282
- package/src/superlocalmemory/math/langevin.py +0 -411
- package/src/superlocalmemory/math/polar_quant.py +0 -414
- package/src/superlocalmemory/math/qjl.py +0 -115
- package/src/superlocalmemory/math/sheaf.py +0 -261
- package/src/superlocalmemory/math/turbo_quant.py +0 -318
- package/src/superlocalmemory/mcp/__init__.py +0 -0
- package/src/superlocalmemory/mcp/_daemon_proxy.py +0 -203
- package/src/superlocalmemory/mcp/_pool_adapter.py +0 -181
- package/src/superlocalmemory/mcp/_stdin_guard.py +0 -60
- package/src/superlocalmemory/mcp/agent_context.py +0 -115
- package/src/superlocalmemory/mcp/cli_fallback.py +0 -602
- package/src/superlocalmemory/mcp/http_transport.py +0 -85
- package/src/superlocalmemory/mcp/profiles.py +0 -154
- package/src/superlocalmemory/mcp/resources.py +0 -281
- package/src/superlocalmemory/mcp/server.py +0 -480
- package/src/superlocalmemory/mcp/session_binding.py +0 -98
- package/src/superlocalmemory/mcp/shared.py +0 -112
- package/src/superlocalmemory/mcp/tools.py +0 -18
- package/src/superlocalmemory/mcp/tools_active.py +0 -958
- package/src/superlocalmemory/mcp/tools_brain.py +0 -298
- package/src/superlocalmemory/mcp/tools_code_graph.py +0 -1717
- package/src/superlocalmemory/mcp/tools_context.py +0 -239
- package/src/superlocalmemory/mcp/tools_core.py +0 -1112
- package/src/superlocalmemory/mcp/tools_evolution.py +0 -343
- package/src/superlocalmemory/mcp/tools_learning.py +0 -393
- package/src/superlocalmemory/mcp/tools_loops.py +0 -345
- package/src/superlocalmemory/mcp/tools_mesh.py +0 -429
- package/src/superlocalmemory/mcp/tools_ops.py +0 -115
- package/src/superlocalmemory/mcp/tools_optimize.py +0 -322
- package/src/superlocalmemory/mcp/tools_summaries.py +0 -147
- package/src/superlocalmemory/mcp/tools_v28.py +0 -292
- package/src/superlocalmemory/mcp/tools_v3.py +0 -398
- package/src/superlocalmemory/mcp/tools_v33.py +0 -507
- package/src/superlocalmemory/mesh/__init__.py +0 -12
- package/src/superlocalmemory/mesh/broker.py +0 -812
- package/src/superlocalmemory/mesh/broker_security.py +0 -470
- package/src/superlocalmemory/mesh/discovery.py +0 -365
- package/src/superlocalmemory/mesh/lock_protocol.py +0 -313
- package/src/superlocalmemory/mesh/node_identity.py +0 -97
- package/src/superlocalmemory/mesh/outbox_remote.py +0 -429
- package/src/superlocalmemory/mesh/remote_sync.py +0 -829
- package/src/superlocalmemory/mesh/state_sync.py +0 -286
- package/src/superlocalmemory/migrations/__init__.py +0 -5
- package/src/superlocalmemory/migrations/v3_4_25_to_v3_4_26.py +0 -144
- package/src/superlocalmemory/optimize/NOTICE +0 -6
- package/src/superlocalmemory/optimize/__init__.py +0 -0
- package/src/superlocalmemory/optimize/adapters/__init__.py +0 -68
- package/src/superlocalmemory/optimize/adapters/_agent_registry.py +0 -120
- package/src/superlocalmemory/optimize/adapters/anthropic_adapter.py +0 -112
- package/src/superlocalmemory/optimize/adapters/openai_adapter.py +0 -122
- package/src/superlocalmemory/optimize/adapters/wrap.py +0 -228
- package/src/superlocalmemory/optimize/cache/__init__.py +0 -31
- package/src/superlocalmemory/optimize/cache/boundary_store.py +0 -488
- package/src/superlocalmemory/optimize/cache/centroid_store.py +0 -199
- package/src/superlocalmemory/optimize/cache/context_key.py +0 -67
- package/src/superlocalmemory/optimize/cache/exact.py +0 -88
- package/src/superlocalmemory/optimize/cache/invalidation.py +0 -36
- package/src/superlocalmemory/optimize/cache/key_builder.py +0 -111
- package/src/superlocalmemory/optimize/cache/manager.py +0 -737
- package/src/superlocalmemory/optimize/cache/semantic.py +0 -637
- package/src/superlocalmemory/optimize/cache/stampede.py +0 -50
- package/src/superlocalmemory/optimize/compress/__init__.py +0 -17
- package/src/superlocalmemory/optimize/compress/align.py +0 -159
- package/src/superlocalmemory/optimize/compress/ccr.py +0 -116
- package/src/superlocalmemory/optimize/compress/prose_llmlingua.py +0 -71
- package/src/superlocalmemory/optimize/compress/router.py +0 -667
- package/src/superlocalmemory/optimize/config/__init__.py +0 -56
- package/src/superlocalmemory/optimize/config/defaults.py +0 -43
- package/src/superlocalmemory/optimize/config/schema.py +0 -327
- package/src/superlocalmemory/optimize/config/store.py +0 -270
- package/src/superlocalmemory/optimize/metrics/__init__.py +0 -8
- package/src/superlocalmemory/optimize/metrics/counters.py +0 -155
- package/src/superlocalmemory/optimize/metrics/estimator.py +0 -87
- package/src/superlocalmemory/optimize/metrics/exporters.py +0 -77
- package/src/superlocalmemory/optimize/metrics/persistence.py +0 -115
- package/src/superlocalmemory/optimize/proxy/__init__.py +0 -28
- package/src/superlocalmemory/optimize/proxy/_helpers.py +0 -730
- package/src/superlocalmemory/optimize/proxy/anthropic_surface.py +0 -375
- package/src/superlocalmemory/optimize/proxy/capture.py +0 -550
- package/src/superlocalmemory/optimize/proxy/gemini_surface.py +0 -528
- package/src/superlocalmemory/optimize/proxy/lifecycle.py +0 -126
- package/src/superlocalmemory/optimize/proxy/openai_surface.py +0 -465
- package/src/superlocalmemory/optimize/proxy/server.py +0 -199
- package/src/superlocalmemory/optimize/proxy/vertex_surface.py +0 -246
- package/src/superlocalmemory/optimize/storage/__init__.py +0 -0
- package/src/superlocalmemory/optimize/storage/db.py +0 -1185
- package/src/superlocalmemory/optimize/storage/schema.py +0 -205
- package/src/superlocalmemory/parameterization/__init__.py +0 -47
- package/src/superlocalmemory/parameterization/cross_project.py +0 -12
- package/src/superlocalmemory/parameterization/pattern_extractor.py +0 -584
- package/src/superlocalmemory/parameterization/pii_filter.py +0 -106
- package/src/superlocalmemory/parameterization/prompt_injector.py +0 -219
- package/src/superlocalmemory/parameterization/prompt_lifecycle.py +0 -281
- package/src/superlocalmemory/parameterization/soft_prompt_generator.py +0 -542
- package/src/superlocalmemory/parameterization/workflow_miner.py +0 -17
- package/src/superlocalmemory/reliability/__init__.py +0 -45
- package/src/superlocalmemory/reliability/join_liveness.py +0 -301
- package/src/superlocalmemory/reliability/prior_distance.py +0 -243
- package/src/superlocalmemory/retrieval/__init__.py +0 -0
- package/src/superlocalmemory/retrieval/agentic.py +0 -367
- package/src/superlocalmemory/retrieval/ann_index.py +0 -235
- package/src/superlocalmemory/retrieval/bm25_channel.py +0 -451
- package/src/superlocalmemory/retrieval/bridge_discovery.py +0 -253
- package/src/superlocalmemory/retrieval/channel_registry.py +0 -154
- package/src/superlocalmemory/retrieval/channel_status.py +0 -117
- package/src/superlocalmemory/retrieval/engine.py +0 -1615
- package/src/superlocalmemory/retrieval/entity_channel.py +0 -994
- package/src/superlocalmemory/retrieval/forgetting_filter.py +0 -160
- package/src/superlocalmemory/retrieval/fusion.py +0 -81
- package/src/superlocalmemory/retrieval/graph_adjacency.py +0 -219
- package/src/superlocalmemory/retrieval/hopfield_channel.py +0 -465
- package/src/superlocalmemory/retrieval/profile_channel.py +0 -105
- package/src/superlocalmemory/retrieval/quantization_aware_search.py +0 -147
- package/src/superlocalmemory/retrieval/remote_reranker.py +0 -758
- package/src/superlocalmemory/retrieval/reranker.py +0 -674
- package/src/superlocalmemory/retrieval/scope_policy.py +0 -126
- package/src/superlocalmemory/retrieval/semantic_channel.py +0 -638
- package/src/superlocalmemory/retrieval/spreading.py +0 -288
- package/src/superlocalmemory/retrieval/spreading_activation.py +0 -616
- package/src/superlocalmemory/retrieval/strategy.py +0 -248
- package/src/superlocalmemory/retrieval/temporal_channel.py +0 -433
- package/src/superlocalmemory/retrieval/temporal_frame.py +0 -102
- package/src/superlocalmemory/retrieval/temporal_utils.py +0 -122
- package/src/superlocalmemory/retrieval/temporal_validity_filter.py +0 -499
- package/src/superlocalmemory/retrieval/time_window.py +0 -181
- package/src/superlocalmemory/retrieval/vector_store.py +0 -863
- package/src/superlocalmemory/server/__init__.py +0 -1
- package/src/superlocalmemory/server/api.py +0 -310
- package/src/superlocalmemory/server/asset_versions.py +0 -171
- package/src/superlocalmemory/server/bandit_loops.py +0 -158
- package/src/superlocalmemory/server/config_file.py +0 -90
- package/src/superlocalmemory/server/consolidation_runner.py +0 -140
- package/src/superlocalmemory/server/egress_policy.py +0 -258
- package/src/superlocalmemory/server/loopback.py +0 -85
- package/src/superlocalmemory/server/middleware/__init__.py +0 -11
- package/src/superlocalmemory/server/middleware/security_headers.py +0 -144
- package/src/superlocalmemory/server/origin.py +0 -55
- package/src/superlocalmemory/server/profile_runtime.py +0 -515
- package/src/superlocalmemory/server/rbac_enforce.py +0 -194
- package/src/superlocalmemory/server/recall_health.py +0 -343
- package/src/superlocalmemory/server/recall_serializer.py +0 -320
- package/src/superlocalmemory/server/route_mutations.py +0 -104
- package/src/superlocalmemory/server/routes/__init__.py +0 -4
- package/src/superlocalmemory/server/routes/abstraction.py +0 -314
- package/src/superlocalmemory/server/routes/adapters.py +0 -63
- package/src/superlocalmemory/server/routes/agents.py +0 -303
- package/src/superlocalmemory/server/routes/backup.py +0 -869
- package/src/superlocalmemory/server/routes/behavioral.py +0 -659
- package/src/superlocalmemory/server/routes/brain.py +0 -1892
- package/src/superlocalmemory/server/routes/chat.py +0 -393
- package/src/superlocalmemory/server/routes/compliance.py +0 -533
- package/src/superlocalmemory/server/routes/config_api.py +0 -703
- package/src/superlocalmemory/server/routes/data_io.py +0 -329
- package/src/superlocalmemory/server/routes/entity.py +0 -237
- package/src/superlocalmemory/server/routes/events.py +0 -214
- package/src/superlocalmemory/server/routes/evolution.py +0 -510
- package/src/superlocalmemory/server/routes/helpers.py +0 -499
- package/src/superlocalmemory/server/routes/ingest.py +0 -137
- package/src/superlocalmemory/server/routes/insights.py +0 -366
- package/src/superlocalmemory/server/routes/learning.py +0 -834
- package/src/superlocalmemory/server/routes/learning_telemetry.py +0 -154
- package/src/superlocalmemory/server/routes/lifecycle.py +0 -184
- package/src/superlocalmemory/server/routes/memories.py +0 -1661
- package/src/superlocalmemory/server/routes/mesh.py +0 -517
- package/src/superlocalmemory/server/routes/mesh_lock.py +0 -54
- package/src/superlocalmemory/server/routes/mesh_state.py +0 -63
- package/src/superlocalmemory/server/routes/optimize.py +0 -197
- package/src/superlocalmemory/server/routes/prewarm.py +0 -173
- package/src/superlocalmemory/server/routes/profiles.py +0 -292
- package/src/superlocalmemory/server/routes/ratelimit.py +0 -132
- package/src/superlocalmemory/server/routes/rbac.py +0 -366
- package/src/superlocalmemory/server/routes/stats.py +0 -385
- package/src/superlocalmemory/server/routes/tiers.py +0 -222
- package/src/superlocalmemory/server/routes/timeline.py +0 -258
- package/src/superlocalmemory/server/routes/token.py +0 -90
- package/src/superlocalmemory/server/routes/v3_api.py +0 -3023
- package/src/superlocalmemory/server/routes/ws.py +0 -171
- package/src/superlocalmemory/server/security_middleware.py +0 -89
- package/src/superlocalmemory/server/ui.py +0 -354
- package/src/superlocalmemory/server/unified_daemon.py +0 -6326
- package/src/superlocalmemory/server/write_identity.py +0 -195
- package/src/superlocalmemory/storage/__init__.py +0 -0
- package/src/superlocalmemory/storage/_migration_internals.py +0 -638
- package/src/superlocalmemory/storage/_schema_version.py +0 -174
- package/src/superlocalmemory/storage/access_log.py +0 -170
- package/src/superlocalmemory/storage/admission_codec.py +0 -129
- package/src/superlocalmemory/storage/admission_journal.py +0 -843
- package/src/superlocalmemory/storage/agent_experience.py +0 -546
- package/src/superlocalmemory/storage/backup.py +0 -531
- package/src/superlocalmemory/storage/correction_cases.py +0 -670
- package/src/superlocalmemory/storage/database.py +0 -3180
- package/src/superlocalmemory/storage/deferred_writes.py +0 -209
- package/src/superlocalmemory/storage/embedding_codec.py +0 -200
- package/src/superlocalmemory/storage/embedding_migrator.py +0 -672
- package/src/superlocalmemory/storage/erasure_fence.py +0 -45
- package/src/superlocalmemory/storage/execution_learning.py +0 -285
- package/src/superlocalmemory/storage/external_evidence.py +0 -359
- package/src/superlocalmemory/storage/generation_fence.py +0 -63
- package/src/superlocalmemory/storage/lineage_retention.py +0 -236
- package/src/superlocalmemory/storage/logical_edges.py +0 -86
- package/src/superlocalmemory/storage/memory_write.py +0 -115
- package/src/superlocalmemory/storage/migration_runner.py +0 -895
- package/src/superlocalmemory/storage/migration_v33.py +0 -140
- package/src/superlocalmemory/storage/migrations/M001_add_signal_features_columns.py +0 -67
- package/src/superlocalmemory/storage/migrations/M002_model_state_history.py +0 -107
- package/src/superlocalmemory/storage/migrations/M003_migration_log.py +0 -38
- package/src/superlocalmemory/storage/migrations/M004_cross_platform_sync_log.py +0 -46
- package/src/superlocalmemory/storage/migrations/M005_bandit_tables.py +0 -75
- package/src/superlocalmemory/storage/migrations/M006_action_outcomes_reward.py +0 -75
- package/src/superlocalmemory/storage/migrations/M007_pending_outcomes.py +0 -63
- package/src/superlocalmemory/storage/migrations/M009_model_lineage.py +0 -94
- package/src/superlocalmemory/storage/migrations/M010_evolution_config.py +0 -80
- package/src/superlocalmemory/storage/migrations/M011_archive_and_merge.py +0 -87
- package/src/superlocalmemory/storage/migrations/M012_shadow_observations.py +0 -72
- package/src/superlocalmemory/storage/migrations/M013_bi_temporal_columns.py +0 -55
- package/src/superlocalmemory/storage/migrations/M014_v345_scale_ready.py +0 -45
- package/src/superlocalmemory/storage/migrations/M015_add_pinned_column.py +0 -58
- package/src/superlocalmemory/storage/migrations/M016_add_scope_support.py +0 -120
- package/src/superlocalmemory/storage/migrations/M017_ccq_scope_column.py +0 -79
- package/src/superlocalmemory/storage/migrations/M018_ingestion_operations.py +0 -120
- package/src/superlocalmemory/storage/migrations/M019_derivation_lineage.py +0 -54
- package/src/superlocalmemory/storage/migrations/M020_model_state_integrity.py +0 -52
- package/src/superlocalmemory/storage/migrations/M021_ingestion_log_profile.py +0 -108
- package/src/superlocalmemory/storage/migrations/M022_entity_aliases_profile.py +0 -86
- package/src/superlocalmemory/storage/migrations/M023_mesh_profile_isolation.py +0 -194
- package/src/superlocalmemory/storage/migrations/M024_rbac_users_roles.py +0 -87
- package/src/superlocalmemory/storage/migrations/M025_perf_indexes.py +0 -90
- package/src/superlocalmemory/storage/migrations/M026_rbac_memberships_fk.py +0 -136
- package/src/superlocalmemory/storage/migrations/M027_transferable_patterns_profile.py +0 -163
- package/src/superlocalmemory/storage/migrations/M028_fact_entity_associations.py +0 -305
- package/src/superlocalmemory/storage/migrations/M029_behavioral_history_indexes.py +0 -137
- package/src/superlocalmemory/storage/migrations/M030_entity_explorer_indexes.py +0 -93
- package/src/superlocalmemory/storage/migrations/M031_dead_letter_operations.py +0 -80
- package/src/superlocalmemory/storage/migrations/M032_write_coordinator_admission.py +0 -188
- package/src/superlocalmemory/storage/migrations/M033_projection_transactions.py +0 -148
- package/src/superlocalmemory/storage/migrations/M034_obligation_integrity.py +0 -58
- package/src/superlocalmemory/storage/migrations/M035_erasure_receipts.py +0 -113
- package/src/superlocalmemory/storage/migrations/M036_vector_row_map.py +0 -107
- package/src/superlocalmemory/storage/migrations/M037_manifest_hmac_version.py +0 -162
- package/src/superlocalmemory/storage/migrations/M038_learning_feedback_channel.py +0 -77
- package/src/superlocalmemory/storage/migrations/M039_scene_fact_members.py +0 -137
- package/src/superlocalmemory/storage/migrations/M040_agent_experience_receipts.py +0 -254
- package/src/superlocalmemory/storage/migrations/M041_external_evidence_receipts.py +0 -189
- package/src/superlocalmemory/storage/migrations/M042_correction_case_ledger.py +0 -245
- package/src/superlocalmemory/storage/migrations/M043_quarantine_display_summaries.py +0 -512
- package/src/superlocalmemory/storage/migrations/M044_play_carries_its_own_evidence.py +0 -127
- package/src/superlocalmemory/storage/migrations/M045_fact_outcome_score.py +0 -158
- package/src/superlocalmemory/storage/migrations/M046_prospective_memory_has_its_own_name.py +0 -620
- package/src/superlocalmemory/storage/migrations/M047_fisher_vectors_are_stored_like_every_other_vector.py +0 -306
- package/src/superlocalmemory/storage/migrations/M048_upcoming_holds_only_what_is_upcoming.py +0 -229
- package/src/superlocalmemory/storage/migrations/M049_a_schema_version_marker_is_one_row.py +0 -201
- package/src/superlocalmemory/storage/migrations/M050_execution_learning_v2.py +0 -70
- package/src/superlocalmemory/storage/migrations/__init__.py +0 -103
- package/src/superlocalmemory/storage/migrations.py +0 -333
- package/src/superlocalmemory/storage/models.py +0 -500
- package/src/superlocalmemory/storage/projection_outbox.py +0 -346
- package/src/superlocalmemory/storage/quantized_store.py +0 -280
- package/src/superlocalmemory/storage/read_connection.py +0 -115
- package/src/superlocalmemory/storage/retention_policy.py +0 -860
- package/src/superlocalmemory/storage/schema.py +0 -1108
- package/src/superlocalmemory/storage/schema_code_graph.py +0 -282
- package/src/superlocalmemory/storage/schema_v32.py +0 -382
- package/src/superlocalmemory/storage/schema_v3410.py +0 -159
- package/src/superlocalmemory/storage/schema_v3411.py +0 -149
- package/src/superlocalmemory/storage/schema_v343.py +0 -315
- package/src/superlocalmemory/storage/schema_v345.py +0 -109
- package/src/superlocalmemory/storage/schema_v347.py +0 -140
- package/src/superlocalmemory/storage/sqlite_vectors.py +0 -169
- package/src/superlocalmemory/storage/v2_migrator.py +0 -466
- package/src/superlocalmemory/storage/write_coordinator.py +0 -949
- package/src/superlocalmemory/storage/write_lock.py +0 -88
- package/src/superlocalmemory/summaries/__init__.py +0 -37
- package/src/superlocalmemory/summaries/base.py +0 -267
- package/src/superlocalmemory/summaries/daily_reflection.py +0 -340
- package/src/superlocalmemory/summaries/non_answer.py +0 -223
- package/src/superlocalmemory/summaries/project_work_log.py +0 -440
- package/src/superlocalmemory/summaries/session_summary.py +0 -311
- package/src/superlocalmemory/trust/__init__.py +0 -0
- package/src/superlocalmemory/trust/gate.py +0 -171
- package/src/superlocalmemory/trust/provenance.py +0 -124
- package/src/superlocalmemory/trust/scorer.py +0 -413
- package/src/superlocalmemory/trust/signals.py +0 -153
- package/src/superlocalmemory/ui/assets/slm-icon-white.svg +0 -64
- package/src/superlocalmemory/ui/assets/slm-icon.svg +0 -36
- package/src/superlocalmemory/ui/css/brain.css +0 -409
- package/src/superlocalmemory/ui/css/design-system.css +0 -696
- package/src/superlocalmemory/ui/css/legacy-dashboard.css +0 -663
- package/src/superlocalmemory/ui/css/neural-glass.css +0 -1599
- package/src/superlocalmemory/ui/css/od-bridge.css +0 -158
- package/src/superlocalmemory/ui/favicon.svg +0 -36
- package/src/superlocalmemory/ui/index.html +0 -1638
- package/src/superlocalmemory/ui/js/agents.js +0 -192
- package/src/superlocalmemory/ui/js/auto-settings.js +0 -624
- package/src/superlocalmemory/ui/js/brain.js +0 -1400
- package/src/superlocalmemory/ui/js/clusters.js +0 -326
- package/src/superlocalmemory/ui/js/compliance.js +0 -307
- package/src/superlocalmemory/ui/js/core.js +0 -566
- package/src/superlocalmemory/ui/js/dashboard.js +0 -503
- package/src/superlocalmemory/ui/js/event-delegation.js +0 -113
- package/src/superlocalmemory/ui/js/events.js +0 -178
- package/src/superlocalmemory/ui/js/fact-detail.js +0 -142
- package/src/superlocalmemory/ui/js/feedback.js +0 -339
- package/src/superlocalmemory/ui/js/graph-event-bus.js +0 -83
- package/src/superlocalmemory/ui/js/graph-filters.js +0 -220
- package/src/superlocalmemory/ui/js/graph-ui.js +0 -214
- package/src/superlocalmemory/ui/js/ide-status.js +0 -115
- package/src/superlocalmemory/ui/js/init.js +0 -54
- package/src/superlocalmemory/ui/js/knowledge-graph.js +0 -945
- package/src/superlocalmemory/ui/js/lifecycle.js +0 -387
- package/src/superlocalmemory/ui/js/math-health.js +0 -114
- package/src/superlocalmemory/ui/js/memories.js +0 -394
- package/src/superlocalmemory/ui/js/memory-chat.js +0 -371
- package/src/superlocalmemory/ui/js/memory-timeline.js +0 -265
- package/src/superlocalmemory/ui/js/modal.js +0 -733
- package/src/superlocalmemory/ui/js/ng-entities.js +0 -298
- package/src/superlocalmemory/ui/js/ng-health.js +0 -208
- package/src/superlocalmemory/ui/js/ng-ingestion.js +0 -203
- package/src/superlocalmemory/ui/js/ng-mesh.js +0 -374
- package/src/superlocalmemory/ui/js/ng-shell.js +0 -524
- package/src/superlocalmemory/ui/js/ng-skills.js +0 -663
- package/src/superlocalmemory/ui/js/od-agents.js +0 -588
- package/src/superlocalmemory/ui/js/od-auth-gate.js +0 -257
- package/src/superlocalmemory/ui/js/od-backup.js +0 -878
- package/src/superlocalmemory/ui/js/od-boundedloops.js +0 -324
- package/src/superlocalmemory/ui/js/od-brain.js +0 -1095
- package/src/superlocalmemory/ui/js/od-compliance-ext.js +0 -301
- package/src/superlocalmemory/ui/js/od-components.js +0 -147
- package/src/superlocalmemory/ui/js/od-entities.js +0 -622
- package/src/superlocalmemory/ui/js/od-graph.js +0 -776
- package/src/superlocalmemory/ui/js/od-health.js +0 -579
- package/src/superlocalmemory/ui/js/od-mcp.js +0 -508
- package/src/superlocalmemory/ui/js/od-memories.js +0 -1499
- package/src/superlocalmemory/ui/js/od-mesh.js +0 -645
- package/src/superlocalmemory/ui/js/od-operations.js +0 -1268
- package/src/superlocalmemory/ui/js/od-ops-health.js +0 -417
- package/src/superlocalmemory/ui/js/od-optimize.js +0 -828
- package/src/superlocalmemory/ui/js/od-settings.js +0 -1275
- package/src/superlocalmemory/ui/js/od-shell.js +0 -819
- package/src/superlocalmemory/ui/js/od-skills.js +0 -600
- package/src/superlocalmemory/ui/js/od-team.js +0 -265
- package/src/superlocalmemory/ui/js/optimize.js +0 -191
- package/src/superlocalmemory/ui/js/profiles.js +0 -362
- package/src/superlocalmemory/ui/js/quick-actions.js +0 -334
- package/src/superlocalmemory/ui/js/recall-lab.js +0 -373
- package/src/superlocalmemory/ui/js/search.js +0 -86
- package/src/superlocalmemory/ui/js/settings.js +0 -556
- package/src/superlocalmemory/ui/js/timeline.js +0 -62
- package/src/superlocalmemory/ui/js/trust-dashboard.js +0 -225
- package/src/superlocalmemory/ui/vendor/bootstrap-icons/bootstrap-icons.css +0 -2018
- package/src/superlocalmemory/ui/vendor/bootstrap-icons/fonts/bootstrap-icons.woff +0 -0
- package/src/superlocalmemory/ui/vendor/bootstrap-icons/fonts/bootstrap-icons.woff2 +0 -0
- package/src/superlocalmemory/ui/vendor/bootstrap.bundle.min.js +0 -7
- package/src/superlocalmemory/ui/vendor/bootstrap.min.css +0 -6
- package/src/superlocalmemory/ui/vendor/d3.v7.min.js +0 -2
- package/src/superlocalmemory/ui/vendor/graphology-library.min.js +0 -2
- package/src/superlocalmemory/ui/vendor/graphology.umd.min.js +0 -2
- package/src/superlocalmemory/ui/vendor/inter-ui/inter-variable.min.css +0 -8
- package/src/superlocalmemory/ui/vendor/inter-ui/variable/InterVariable-Italic.woff2 +0 -0
- package/src/superlocalmemory/ui/vendor/inter-ui/variable/InterVariable.woff2 +0 -0
- package/src/superlocalmemory/ui/vendor/sigma.min.js +0 -1
- package/src/superlocalmemory/vector/__init__.py +0 -9
- package/src/superlocalmemory/vector/lancedb_backend.py +0 -366
|
@@ -1,1095 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2026 Varun Pratap Bhardwaj / Qualixar — AGPL-3.0
|
|
2
|
-
// od-brain.js — OD-themed "Living Brain" screen for SuperLocalMemory.
|
|
3
|
-
//
|
|
4
|
-
// Renders the approved design into window.odRenderBrain(container).
|
|
5
|
-
// ALL data from these confirmed live endpoints (no seed / no invented data):
|
|
6
|
-
// GET /api/learning/status → ranking_phase, stats, engagement, tech_preferences,
|
|
7
|
-
// workflow_patterns, persisted source-quality posteriors
|
|
8
|
-
// GET /api/behavioral/status → reward_telemetry, explicit outcome counts,
|
|
9
|
-
// patterns[], transfers, recent_outcomes[]
|
|
10
|
-
// GET /api/behavioral/assertions?category=skill_performance&limit=50 → assertions[]
|
|
11
|
-
// GET /api/behavioral/tool-events?limit=500 → events[].{created_at,tool_name,…}
|
|
12
|
-
//
|
|
13
|
-
// Heatmap is built from tool-events aggregated by UTC date — real activity density,
|
|
14
|
-
// not the random slmHeatmap() fallback.
|
|
15
|
-
//
|
|
16
|
-
// CSP-safe: no eval(), no innerHTML for API data, no inline event handlers.
|
|
17
|
-
// Immutable style: EL() always creates new nodes; no mutation of existing DOM.
|
|
18
|
-
|
|
19
|
-
/* global window, document, fetch, Promise, setTimeout, getComputedStyle */
|
|
20
|
-
|
|
21
|
-
(function () {
|
|
22
|
-
'use strict';
|
|
23
|
-
|
|
24
|
-
// ======================================================================
|
|
25
|
-
// Fetch
|
|
26
|
-
// ======================================================================
|
|
27
|
-
function apiFetch(path) {
|
|
28
|
-
return fetch(path, { credentials: 'same-origin' })
|
|
29
|
-
.then(function (r) {
|
|
30
|
-
if (!r.ok) throw new Error(path + ' → ' + r.status);
|
|
31
|
-
return r.json();
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function fetchLivingBrain() {
|
|
36
|
-
// The canonical Living Brain read model is install-token gated. The
|
|
37
|
-
// browser obtains that token only from the local same-origin endpoint;
|
|
38
|
-
// it is never rendered, stored, or sent to another origin.
|
|
39
|
-
return apiFetch('/internal/token').then(function (tokenBody) {
|
|
40
|
-
var token = tokenBody && typeof tokenBody.token === 'string'
|
|
41
|
-
? tokenBody.token.trim() : '';
|
|
42
|
-
if (!token) throw new Error('/internal/token → missing token');
|
|
43
|
-
return fetch('/api/v3/brain', {
|
|
44
|
-
credentials: 'same-origin',
|
|
45
|
-
headers: { 'X-Install-Token': token },
|
|
46
|
-
}).then(function (r) {
|
|
47
|
-
if (!r.ok) throw new Error('/api/v3/brain → ' + r.status);
|
|
48
|
-
return r.json();
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function fetchAll() {
|
|
54
|
-
return Promise.all([
|
|
55
|
-
apiFetch('/api/learning/status'),
|
|
56
|
-
apiFetch('/api/behavioral/status'),
|
|
57
|
-
apiFetch('/api/behavioral/assertions?category=skill_performance&limit=50'),
|
|
58
|
-
apiFetch('/api/behavioral/tool-events?limit=500'),
|
|
59
|
-
fetchLivingBrain(),
|
|
60
|
-
]);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// ======================================================================
|
|
64
|
-
// DOM helper — API strings always go through .text → textContent (XSS-safe)
|
|
65
|
-
// ======================================================================
|
|
66
|
-
function EL(tag, props, kids) {
|
|
67
|
-
var el = document.createElement(tag);
|
|
68
|
-
var p = props || {};
|
|
69
|
-
Object.keys(p).forEach(function (k) {
|
|
70
|
-
if (k === 'className') el.className = String(p[k]);
|
|
71
|
-
else if (k === 'text') el.textContent = p[k] == null ? '' : String(p[k]);
|
|
72
|
-
else el.setAttribute(k, String(p[k]));
|
|
73
|
-
});
|
|
74
|
-
(kids || []).forEach(function (c) { if (c != null) el.appendChild(c); });
|
|
75
|
-
return el;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// ======================================================================
|
|
79
|
-
// Formatters
|
|
80
|
-
// ======================================================================
|
|
81
|
-
function fmtNum(n) { return Number(n || 0).toLocaleString(); }
|
|
82
|
-
|
|
83
|
-
function fmtKB(kb) {
|
|
84
|
-
var v = Number(kb || 0);
|
|
85
|
-
if (v === 0) return '0 KB';
|
|
86
|
-
return v < 1024 ? v.toFixed(1) + ' KB' : (v / 1024).toFixed(1) + ' MB';
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function phaseLabel(raw) {
|
|
90
|
-
// Map known phase keys to human labels. Never string-mangle an internal
|
|
91
|
-
// identifier — unknown values fall back to a plain-English generic.
|
|
92
|
-
var LABELS = {
|
|
93
|
-
baseline: 'Baseline',
|
|
94
|
-
rule_based: 'Rule-based',
|
|
95
|
-
ml_model: 'ML model',
|
|
96
|
-
cold_start: 'Starting out',
|
|
97
|
-
};
|
|
98
|
-
var key = (raw || 'cold_start').toLowerCase().replace(/-/g, '_').replace(/\s+/g, '_');
|
|
99
|
-
return LABELS[key] || (raw ? String(raw).replace(/[-_]/g, ' ') : 'Starting out');
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
// ======================================================================
|
|
103
|
-
// Heatmap — real activity density from tool-events aggregated by UTC date
|
|
104
|
-
// ======================================================================
|
|
105
|
-
function buildDateMap(events) {
|
|
106
|
-
var map = {};
|
|
107
|
-
(events || []).forEach(function (e) {
|
|
108
|
-
if (!e.created_at) return;
|
|
109
|
-
var d = String(e.created_at).slice(0, 10);
|
|
110
|
-
map[d] = (map[d] || 0) + 1;
|
|
111
|
-
});
|
|
112
|
-
return map;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
function signalLevel(count) {
|
|
116
|
-
if (count <= 0) return 0;
|
|
117
|
-
if (count <= 3) return 1;
|
|
118
|
-
if (count <= 10) return 2;
|
|
119
|
-
if (count <= 25) return 3;
|
|
120
|
-
return 4;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
function buildHeatmap(el, dateMap, weeks) {
|
|
124
|
-
var totalDays = (weeks || 26) * 7;
|
|
125
|
-
var today = new Date(); today.setHours(0, 0, 0, 0);
|
|
126
|
-
el.replaceChildren();
|
|
127
|
-
for (var i = 0; i < totalDays; i++) {
|
|
128
|
-
var d = new Date(today);
|
|
129
|
-
d.setDate(today.getDate() - (totalDays - 1 - i));
|
|
130
|
-
var ds = d.toISOString().slice(0, 10);
|
|
131
|
-
var cnt = (dateMap && dateMap[ds]) || 0;
|
|
132
|
-
var cell = document.createElement('i');
|
|
133
|
-
cell.setAttribute('data-l', String(signalLevel(cnt)));
|
|
134
|
-
cell.setAttribute('title', ds + ': ' + cnt + ' event' + (cnt === 1 ? '' : 's'));
|
|
135
|
-
el.appendChild(cell);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// ======================================================================
|
|
140
|
-
// UI primitives
|
|
141
|
-
// ======================================================================
|
|
142
|
-
function meter(pct, color) {
|
|
143
|
-
var outer = EL('div', { className: 'meter' });
|
|
144
|
-
var fill = document.createElement('i');
|
|
145
|
-
fill.style.width = Math.min(100, Math.max(0, pct)) + '%';
|
|
146
|
-
if (color) fill.style.background = color;
|
|
147
|
-
outer.appendChild(fill);
|
|
148
|
-
return outer;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
function inlineBar(pct) {
|
|
152
|
-
var wrap = EL('span', {
|
|
153
|
-
style: 'display:inline-block;vertical-align:middle;width:56px;height:6px;' +
|
|
154
|
-
'border-radius:99px;background:var(--card-2);overflow:hidden;margin-right:6px',
|
|
155
|
-
});
|
|
156
|
-
wrap.appendChild(EL('span', {
|
|
157
|
-
style: 'display:block;height:100%;width:' + Math.min(100, pct) + '%;' +
|
|
158
|
-
'background:linear-gradient(90deg,var(--cyan),var(--violet))',
|
|
159
|
-
}));
|
|
160
|
-
return wrap;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
function humanizeSource(raw) {
|
|
164
|
-
// Map raw internal capability IDs to plain names a non-technical user can read.
|
|
165
|
-
// IDs follow patterns such as http:daemon-capability:<hex> or
|
|
166
|
-
// dashboard:local-capability:http-route:uid:<uid>:<hex>.
|
|
167
|
-
// Strip trailing hex hashes, then map the leading protocol/type prefix.
|
|
168
|
-
var s = String(raw || '')
|
|
169
|
-
.replace(/:?[0-9a-f]{40,}$/i, '')
|
|
170
|
-
.replace(/:?[0-9a-f]{32,}$/i, '')
|
|
171
|
-
.replace(/:$/, '')
|
|
172
|
-
.trim();
|
|
173
|
-
var prefix = (s.split(':')[0] || '').toLowerCase();
|
|
174
|
-
var MAP = {
|
|
175
|
-
http: 'Background service',
|
|
176
|
-
https: 'Background service',
|
|
177
|
-
dashboard: 'Dashboard',
|
|
178
|
-
cli: 'Command line',
|
|
179
|
-
'claude-code': 'Claude Code',
|
|
180
|
-
claude_code: 'Claude Code',
|
|
181
|
-
copilot: 'Copilot',
|
|
182
|
-
cursor: 'Cursor',
|
|
183
|
-
mcp: 'MCP server',
|
|
184
|
-
daemon: 'Background service',
|
|
185
|
-
};
|
|
186
|
-
if (MAP[prefix]) return MAP[prefix];
|
|
187
|
-
// Fall back: take the first segment, replace underscores/dashes, capitalise.
|
|
188
|
-
var label = prefix.replace(/[-_]/g, ' ').trim();
|
|
189
|
-
return label ? label.charAt(0).toUpperCase() + label.slice(1) : String(raw);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
function heatLegend() {
|
|
193
|
-
var w = EL('div', { className: 'heat-legend' });
|
|
194
|
-
w.appendChild(document.createTextNode('less '));
|
|
195
|
-
for (var i = 0; i <= 4; i++) w.appendChild(EL('i', { 'data-l': String(i) }));
|
|
196
|
-
w.appendChild(document.createTextNode(' more'));
|
|
197
|
-
return w;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
// isNumeric=true → class="value num" (tabular digits, 30px default from CSS)
|
|
201
|
-
// isNumeric=false → class="value" + font-size:24px (design uses smaller text for long labels)
|
|
202
|
-
function kpiCard(icon, label, value, delta, dUp, vColor, isNumeric) {
|
|
203
|
-
var card = EL('div', { className: 'card kpi' });
|
|
204
|
-
var lbl = EL('div', { className: 'label' });
|
|
205
|
-
if (typeof window.slmIcon === 'function') {
|
|
206
|
-
var ic = document.createElement('span');
|
|
207
|
-
ic.innerHTML = window.slmIcon(icon);
|
|
208
|
-
lbl.appendChild(ic);
|
|
209
|
-
}
|
|
210
|
-
lbl.appendChild(document.createTextNode(' ' + label));
|
|
211
|
-
var val = EL('div', { className: isNumeric ? 'value num' : 'value', text: value });
|
|
212
|
-
if (!isNumeric) val.style.fontSize = '24px';
|
|
213
|
-
if (vColor) val.style.color = vColor;
|
|
214
|
-
card.appendChild(lbl);
|
|
215
|
-
card.appendChild(val);
|
|
216
|
-
card.appendChild(EL('div', { className: 'delta ' + (dUp ? 'up' : ''), text: delta }));
|
|
217
|
-
return card;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
// ======================================================================
|
|
221
|
-
// Phase style injection (once — not in design-system.css yet)
|
|
222
|
-
// ======================================================================
|
|
223
|
-
function injectPhaseStyle() {
|
|
224
|
-
if (document.getElementById('od-brain-phase-style')) return;
|
|
225
|
-
var st = document.createElement('style');
|
|
226
|
-
st.id = 'od-brain-phase-style';
|
|
227
|
-
st.textContent =
|
|
228
|
-
'.phase{flex:1;text-align:center;padding:10px 6px;border-radius:var(--r-md);' +
|
|
229
|
-
'background:var(--card-2);border:1px solid var(--border)}' +
|
|
230
|
-
'.phase b{display:block;font-size:13px}' +
|
|
231
|
-
'.phase span{font-size:11px;color:var(--fg-3)}' +
|
|
232
|
-
'.phase.done{border-color:color-mix(in srgb,var(--ok) 40%,transparent)}' +
|
|
233
|
-
'.phase.done b{color:var(--ok)}' +
|
|
234
|
-
'.phase.now{border-color:var(--violet-line);background:var(--violet-soft)}' +
|
|
235
|
-
'.phase.now b{color:var(--violet)}';
|
|
236
|
-
document.head.appendChild(st);
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
// ======================================================================
|
|
240
|
-
// Tab: OVERVIEW
|
|
241
|
-
// ======================================================================
|
|
242
|
-
function buildOverview(learning, behavioral, dateMap, living) {
|
|
243
|
-
var sec = EL('section', { className: 'tabpane active', 'data-p': 'overview' });
|
|
244
|
-
var stats = (learning && learning.stats) || {};
|
|
245
|
-
var eng = (learning && learning.engagement) || {};
|
|
246
|
-
var beh = behavioral || {};
|
|
247
|
-
var ranker = (learning && learning.ranker_phase) || {};
|
|
248
|
-
var gates = ranker.gates || {};
|
|
249
|
-
var ruleGate = Math.max(1, Number(gates.rule_based_min_signals || 1));
|
|
250
|
-
var mlGate = Math.max(ruleGate, Number(gates.ml_model_min_signals || ruleGate));
|
|
251
|
-
var signals = Number(ranker.signals != null
|
|
252
|
-
? ranker.signals : stats.ranker_signal_count || 0);
|
|
253
|
-
var pct = Math.min(100, Math.round(signals / mlGate * 100));
|
|
254
|
-
var phase = ranker.key || (learning && learning.ranking_phase) || 'baseline';
|
|
255
|
-
var phaseNumber = Number(ranker.phase || 1);
|
|
256
|
-
var modelActive = Boolean(ranker.model_active);
|
|
257
|
-
var phaseDelta = modelActive
|
|
258
|
-
? 'Personalised model active'
|
|
259
|
-
: signals < mlGate
|
|
260
|
-
? fmtNum(mlGate - signals) + ' more interactions to unlock personalisation'
|
|
261
|
-
: 'Ready to personalise — awaiting model verification';
|
|
262
|
-
var healthStatus = (eng.health_status || 'INACTIVE').toUpperCase();
|
|
263
|
-
var healthColor = healthStatus === 'HEALTHY' ? 'var(--ok)'
|
|
264
|
-
: healthStatus === 'ACTIVE' ? 'var(--cyan)' : undefined;
|
|
265
|
-
var pCount = ((beh.patterns) || []).length;
|
|
266
|
-
// BrainTruth is the portable V4.0.5 source of truth. Legacy sections
|
|
267
|
-
// remain a rolling-upgrade fallback only.
|
|
268
|
-
var truth = (living && living.brain_truth) || {};
|
|
269
|
-
var memoryActivity = truth.memory_activity || {};
|
|
270
|
-
var feedback = truth.feedback || (living && living.feedback) || {};
|
|
271
|
-
var experience = truth.agent_experience || (living && living.agent_experience) || {};
|
|
272
|
-
var externalEvidence = truth.external_evidence || experience.external_graph_evidence || {};
|
|
273
|
-
var correctionQuality = truth.correction_quality || {};
|
|
274
|
-
var graph = (living && living.graph) || {};
|
|
275
|
-
|
|
276
|
-
function truthCount(section, key, unit) {
|
|
277
|
-
if (!section || section.availability === 'unavailable') {
|
|
278
|
-
return 'Unavailable' + (section && section.reason ? ': ' + section.reason : '');
|
|
279
|
-
}
|
|
280
|
-
var value = section[key];
|
|
281
|
-
return value == null ? 'No data yet' : String(value) + (unit ? ' ' + unit : '');
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
// KPI strip
|
|
285
|
-
var strip = EL('div', { className: 'kpi-strip', style: 'margin-bottom:16px' });
|
|
286
|
-
// Ranking phase: text label → isNumeric=false (font-size:24px to match design)
|
|
287
|
-
strip.appendChild(kpiCard('skill', 'Ranking phase', phaseLabel(phase),
|
|
288
|
-
phaseDelta, modelActive, undefined, false));
|
|
289
|
-
// Questions answered: unique queries is the meaningful unit — total signals is context.
|
|
290
|
-
// 5,339 signals across 3 unique queries means one query repeated, not broad learning.
|
|
291
|
-
var uniqueQ = Number(stats.unique_queries || 0);
|
|
292
|
-
strip.appendChild(kpiCard('optimize', 'Questions answered', fmtNum(uniqueQ),
|
|
293
|
-
uniqueQ > 0
|
|
294
|
-
? fmtNum(signals) + ' total interactions'
|
|
295
|
-
: 'no questions asked yet',
|
|
296
|
-
uniqueQ > 0, undefined, true));
|
|
297
|
-
// Engagement health: text label → isNumeric=false
|
|
298
|
-
strip.appendChild(kpiCard('health', 'Engagement health',
|
|
299
|
-
healthStatus.charAt(0) + healthStatus.slice(1).toLowerCase(),
|
|
300
|
-
(eng.days_active || 0) + ' days active · ' + Number(eng.memories_per_day || 0).toFixed(1) + ' saves/day',
|
|
301
|
-
healthStatus === 'HEALTHY', healthColor, false));
|
|
302
|
-
// Patterns: numeric → isNumeric=true
|
|
303
|
-
strip.appendChild(kpiCard('brain', 'Patterns learned', String(pCount),
|
|
304
|
-
(beh.cross_project_transfers || 0) + ' used across projects', pCount > 0, undefined, true));
|
|
305
|
-
sec.appendChild(strip);
|
|
306
|
-
|
|
307
|
-
// 2-column grid
|
|
308
|
-
var grid = EL('div', { className: 'grid', style: 'grid-template-columns:1fr 1fr;align-items:start' });
|
|
309
|
-
|
|
310
|
-
// Progress card
|
|
311
|
-
var pcrd = EL('div', { className: 'card' });
|
|
312
|
-
var ph = EL('div', { className: 'card-head' });
|
|
313
|
-
ph.appendChild(EL('h3', { text: 'Adaptive ranking progress' }));
|
|
314
|
-
ph.appendChild(EL('span', { className: 'sub', text: 'baseline → rule-based → ML model' }));
|
|
315
|
-
pcrd.appendChild(ph);
|
|
316
|
-
var pb = EL('div', { className: 'card-pad' });
|
|
317
|
-
var pmeta = EL('div', {
|
|
318
|
-
style: 'display:flex;justify-content:space-between;font-size:12px;color:var(--fg-2);margin-bottom:8px',
|
|
319
|
-
});
|
|
320
|
-
if (signals >= mlGate) {
|
|
321
|
-
// Gate already passed — showing the overrun fraction (e.g. "5,339 / 200") is
|
|
322
|
-
// misleading. Show the done state and what comes next instead.
|
|
323
|
-
pmeta.appendChild(EL('span', { text: fmtNum(signals) + ' interactions · gate passed' }));
|
|
324
|
-
var gdBadge = EL('span', { className: 'badge ' + (modelActive ? 'ok' : 'warn') });
|
|
325
|
-
gdBadge.appendChild(document.createTextNode(modelActive ? 'model active' : 'awaiting verification'));
|
|
326
|
-
pmeta.appendChild(gdBadge);
|
|
327
|
-
} else {
|
|
328
|
-
pmeta.appendChild(EL('span', { text: fmtNum(signals) + ' of ' + fmtNum(mlGate) + ' interactions' }));
|
|
329
|
-
pmeta.appendChild(EL('span', { className: 'num', text: pct + '%' }));
|
|
330
|
-
}
|
|
331
|
-
pb.appendChild(pmeta);
|
|
332
|
-
pb.appendChild(meter(pct));
|
|
333
|
-
var phasesRow = EL('div', {
|
|
334
|
-
style: 'display:flex;justify-content:space-between;margin-top:18px;gap:12px',
|
|
335
|
-
});
|
|
336
|
-
[
|
|
337
|
-
{
|
|
338
|
-
t: 'Baseline',
|
|
339
|
-
d: '0–' + Math.max(0, ruleGate - 1) + ' signals',
|
|
340
|
-
done: phaseNumber > 1,
|
|
341
|
-
now: phaseNumber === 1,
|
|
342
|
-
},
|
|
343
|
-
{
|
|
344
|
-
t: 'Rule-Based',
|
|
345
|
-
d: fmtNum(ruleGate) + '–' + fmtNum(Math.max(ruleGate, mlGate - 1)) + ' signals',
|
|
346
|
-
done: phaseNumber > 2,
|
|
347
|
-
now: phaseNumber === 2,
|
|
348
|
-
},
|
|
349
|
-
{
|
|
350
|
-
t: 'ML Model',
|
|
351
|
-
d: fmtNum(mlGate) + '+ · ' + (modelActive ? 'verified active' : 'verified model required'),
|
|
352
|
-
done: false,
|
|
353
|
-
now: phaseNumber === 3 && modelActive,
|
|
354
|
-
},
|
|
355
|
-
].forEach(function (phI) {
|
|
356
|
-
var el = EL('div', {
|
|
357
|
-
className: 'phase' + (phI.done ? ' done' : '') + (phI.now ? ' now' : ''),
|
|
358
|
-
});
|
|
359
|
-
el.appendChild(EL('b', { text: phI.t }));
|
|
360
|
-
el.appendChild(EL('span', { text: phI.d }));
|
|
361
|
-
phasesRow.appendChild(el);
|
|
362
|
-
});
|
|
363
|
-
pb.appendChild(phasesRow);
|
|
364
|
-
pcrd.appendChild(pb);
|
|
365
|
-
grid.appendChild(pcrd);
|
|
366
|
-
|
|
367
|
-
// Privacy card
|
|
368
|
-
var priv = EL('div', { className: 'card' });
|
|
369
|
-
var prvh = EL('div', { className: 'card-head' });
|
|
370
|
-
prvh.appendChild(EL('h3', { text: 'Privacy & data' }));
|
|
371
|
-
prvh.appendChild(EL('span', { className: 'sub', text: 'learning.db — separate from memory.db' }));
|
|
372
|
-
priv.appendChild(prvh);
|
|
373
|
-
var prvb = EL('div', { className: 'card-pad', style: 'display:flex;flex-direction:column;gap:2px' });
|
|
374
|
-
[
|
|
375
|
-
['Learning DB size', fmtKB(stats.db_size_kb)],
|
|
376
|
-
['Patterns learned', String(pCount)],
|
|
377
|
-
['Models trained', String(stats.models_trained || 0)],
|
|
378
|
-
['Verified active models', String(stats.models_active_verified || 0)],
|
|
379
|
-
['Sources tracked', String(stats.tracked_sources || 0)],
|
|
380
|
-
['Memory activity', truthCount(memoryActivity, 'facts_total', 'facts')],
|
|
381
|
-
['Feedback signals', truthCount(feedback, 'signals_total', 'signals')],
|
|
382
|
-
['Claimed evidence', truthCount(experience, 'claimed_experiences_total', '')],
|
|
383
|
-
['Independently verified evidence', truthCount(
|
|
384
|
-
experience, 'independently_verified_experiences_total', '',
|
|
385
|
-
)],
|
|
386
|
-
['External observations', truthCount(externalEvidence, 'receipts_total', '')],
|
|
387
|
-
['Correction quality', truthCount(correctionQuality, 'cases_total', '')],
|
|
388
|
-
['Graph evidence', String(graph.fact_nodes || 0) + ' nodes · ' +
|
|
389
|
-
String(graph.association_edges || 0) + ' edges'],
|
|
390
|
-
].forEach(function (row) {
|
|
391
|
-
var r = EL('div', { className: 'list-row' });
|
|
392
|
-
r.appendChild(EL('span', { className: 'muted', style: 'flex:1', text: row[0] }));
|
|
393
|
-
r.appendChild(EL('b', { className: 'num', text: row[1] }));
|
|
394
|
-
prvb.appendChild(r);
|
|
395
|
-
});
|
|
396
|
-
var lr = EL('div', { className: 'list-row' });
|
|
397
|
-
lr.appendChild(EL('span', { className: 'muted', style: 'flex:1', text: 'Never leaves device' }));
|
|
398
|
-
var badge = EL('span', { className: 'badge ok' });
|
|
399
|
-
badge.appendChild(EL('span', { className: 'dot' }));
|
|
400
|
-
badge.appendChild(document.createTextNode(' local'));
|
|
401
|
-
lr.appendChild(badge);
|
|
402
|
-
prvb.appendChild(lr);
|
|
403
|
-
priv.appendChild(prvb);
|
|
404
|
-
grid.appendChild(priv);
|
|
405
|
-
sec.appendChild(grid);
|
|
406
|
-
|
|
407
|
-
// Keep evidence distinct from ranking or reward so a non-technical user
|
|
408
|
-
// can see what SLM observed without inferring an automatic behavior change.
|
|
409
|
-
var evc = EL('div', { className: 'card', style: 'margin-top:16px' });
|
|
410
|
-
var evh = EL('div', { className: 'card-head' });
|
|
411
|
-
evh.appendChild(EL('h3', { text: 'Agent evidence' }));
|
|
412
|
-
evh.appendChild(EL('span', { className: 'sub', text: 'local receipts · observation only' }));
|
|
413
|
-
evc.appendChild(evh);
|
|
414
|
-
var evb = EL('div', { className: 'card-pad' });
|
|
415
|
-
evb.appendChild(EL('p', {
|
|
416
|
-
className: 'muted',
|
|
417
|
-
style: 'margin:0 0 14px;font-size:12px;line-height:1.55',
|
|
418
|
-
text: 'SLM records completed work when an integration supplies evidence. These records do not change recall, ranking, or model routing by themselves.',
|
|
419
|
-
}));
|
|
420
|
-
// Three plain-language KPI cards.
|
|
421
|
-
// Technical labels (Claimed evidence, Independently verified evidence,
|
|
422
|
-
// External observations, Correction quality) are preserved in the
|
|
423
|
-
// Privacy card rows above for test and audit traceability.
|
|
424
|
-
var claimedCount = Number(experience.claimed_experiences_total || 0);
|
|
425
|
-
var corrCount = Number(correctionQuality.cases_total || 0);
|
|
426
|
-
var obsCount = Number(externalEvidence.receipts_total || 0);
|
|
427
|
-
var evGrid = EL('div', { className: 'kpi-strip', style: 'margin:0' });
|
|
428
|
-
evGrid.appendChild(kpiCard('fact_check', 'Tasks completed',
|
|
429
|
-
truthCount(experience, 'claimed_experiences_total', ''),
|
|
430
|
-
claimedCount > 0 ? 'work recorded from connected tools' : 'no tasks recorded yet',
|
|
431
|
-
claimedCount > 0, undefined, true));
|
|
432
|
-
evGrid.appendChild(kpiCard('tune', 'Corrections applied',
|
|
433
|
-
truthCount(correctionQuality, 'cases_total', ''),
|
|
434
|
-
corrCount > 0 ? 'improvements applied to results' : 'no corrections recorded yet',
|
|
435
|
-
corrCount > 0, undefined, true));
|
|
436
|
-
evGrid.appendChild(kpiCard('science', 'Observations logged',
|
|
437
|
-
truthCount(externalEvidence, 'receipts_total', ''),
|
|
438
|
-
externalEvidence.availability === 'available' &&
|
|
439
|
-
Number(externalEvidence.demonstrations_total || 0) > 0
|
|
440
|
-
? String(externalEvidence.demonstrations_total) + ' demonstrations'
|
|
441
|
-
: 'no external demonstrations yet',
|
|
442
|
-
obsCount > 0, undefined, true));
|
|
443
|
-
evb.appendChild(evGrid);
|
|
444
|
-
evc.appendChild(evb);
|
|
445
|
-
sec.appendChild(evc);
|
|
446
|
-
|
|
447
|
-
// Activity heatmap (tool events are activity, never reward labels)
|
|
448
|
-
var hmc = EL('div', { className: 'card', style: 'margin-top:16px' });
|
|
449
|
-
var hmh = EL('div', { className: 'card-head' });
|
|
450
|
-
hmh.appendChild(EL('h3', { text: 'Memory activity' }));
|
|
451
|
-
hmh.appendChild(EL('span', { className: 'sub', text: 'tool events · last 26 weeks' }));
|
|
452
|
-
hmh.appendChild(EL('div', { className: 'spacer' }));
|
|
453
|
-
hmh.appendChild(heatLegend());
|
|
454
|
-
hmc.appendChild(hmh);
|
|
455
|
-
var hmb = EL('div', { className: 'card-pad', style: 'overflow-x:auto' });
|
|
456
|
-
var hmEl = EL('div', { className: 'heatmap', id: 'od-brain-heat1' });
|
|
457
|
-
buildHeatmap(hmEl, dateMap, 26);
|
|
458
|
-
hmb.appendChild(hmEl);
|
|
459
|
-
hmc.appendChild(hmb);
|
|
460
|
-
sec.appendChild(hmc);
|
|
461
|
-
return sec;
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
// ======================================================================
|
|
465
|
-
// Tab: REWARD SIGNAL
|
|
466
|
-
// ======================================================================
|
|
467
|
-
function buildReward(behavioral) {
|
|
468
|
-
var sec = EL('section', { className: 'tabpane', 'data-p': 'reward' });
|
|
469
|
-
var beh = behavioral || {};
|
|
470
|
-
var reward = beh.reward_telemetry || {};
|
|
471
|
-
var timeline = reward.timeline || [];
|
|
472
|
-
var rewardDateMap = {};
|
|
473
|
-
timeline.forEach(function (point) {
|
|
474
|
-
if (point && point.date) rewardDateMap[String(point.date)] = Number(point.count || 0);
|
|
475
|
-
});
|
|
476
|
-
|
|
477
|
-
// Density heatmap
|
|
478
|
-
var hmcr = EL('div', { className: 'card', style: 'margin-bottom:16px' });
|
|
479
|
-
var hmhr = EL('div', { className: 'card-head' });
|
|
480
|
-
hmhr.appendChild(EL('h3', { text: 'Reward signal density' }));
|
|
481
|
-
hmhr.appendChild(EL('span', {
|
|
482
|
-
className: 'sub',
|
|
483
|
-
text: 'feedback events per day · last ' + Number(reward.window_days || 182) + ' days',
|
|
484
|
-
}));
|
|
485
|
-
hmhr.appendChild(EL('div', { className: 'spacer' }));
|
|
486
|
-
hmhr.appendChild(heatLegend());
|
|
487
|
-
hmcr.appendChild(hmhr);
|
|
488
|
-
var hmbr = EL('div', { className: 'card-pad', style: 'overflow-x:auto' });
|
|
489
|
-
var hmElR = EL('div', { className: 'heatmap', id: 'od-brain-heat2' });
|
|
490
|
-
buildHeatmap(hmElR, rewardDateMap, 26);
|
|
491
|
-
hmbr.appendChild(hmElR);
|
|
492
|
-
hmcr.appendChild(hmbr);
|
|
493
|
-
sec.appendChild(hmcr);
|
|
494
|
-
|
|
495
|
-
// Compute distribution state once so both cards use the same values.
|
|
496
|
-
var total = Number(reward.count || 0);
|
|
497
|
-
var bd = reward.distribution || {};
|
|
498
|
-
// isUnmeasuredPrior: when positive=0 and negative=0, every label sits on the
|
|
499
|
-
// initialization value (0.5). That is the absence of differentiation, not a
|
|
500
|
-
// finding — render it honestly rather than as a measured result.
|
|
501
|
-
var isUnmeasuredPrior = total > 0
|
|
502
|
-
&& Number(bd.positive || 0) === 0
|
|
503
|
-
&& Number(bd.negative || 0) === 0;
|
|
504
|
-
|
|
505
|
-
// 2-column: sparkline + outcome mix
|
|
506
|
-
var grid = EL('div', { className: 'grid', style: 'grid-template-columns:1fr 1fr;align-items:start' });
|
|
507
|
-
|
|
508
|
-
// Recall quality card: average reward score + real daily sparkline
|
|
509
|
-
var fbCard = EL('div', { className: 'card' });
|
|
510
|
-
var fbH = EL('div', { className: 'card-head' });
|
|
511
|
-
fbH.appendChild(EL('h3', { text: 'Recall quality' }));
|
|
512
|
-
fbH.appendChild(EL('span', {
|
|
513
|
-
className: 'sub',
|
|
514
|
-
text: fmtNum(reward.count || 0) + (isUnmeasuredPrior ? ' interactions · default score' : ' interactions'),
|
|
515
|
-
}));
|
|
516
|
-
fbCard.appendChild(fbH);
|
|
517
|
-
var fbB = EL('div', { className: 'card-pad' });
|
|
518
|
-
if (reward.average != null) {
|
|
519
|
-
fbB.appendChild(EL('div', {
|
|
520
|
-
className: 'value num',
|
|
521
|
-
style: 'font-size:30px;margin-bottom:12px',
|
|
522
|
-
text: Number(reward.average).toFixed(3),
|
|
523
|
-
}));
|
|
524
|
-
if (isUnmeasuredPrior) {
|
|
525
|
-
fbB.appendChild(EL('p', {
|
|
526
|
-
className: 'muted',
|
|
527
|
-
style: 'font-size:12px;margin-top:4px;margin-bottom:0',
|
|
528
|
-
text: 'Starting value — no differentiated engagement yet.',
|
|
529
|
-
}));
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
var fbSp = EL('div', { id: 'od-brain-sp-fb' });
|
|
533
|
-
var sparkVals = timeline.slice(-30).map(function (point) {
|
|
534
|
-
return Number(point.average || 0);
|
|
535
|
-
});
|
|
536
|
-
var hasSparkData = sparkVals.length > 0;
|
|
537
|
-
if (hasSparkData && typeof window.slmSpark === 'function') {
|
|
538
|
-
fbSp.innerHTML = window.slmSpark(sparkVals, { w: 600, h: 150, color: 'var(--violet)' });
|
|
539
|
-
var sv1 = fbSp.querySelector('svg'); if (sv1) sv1.style.height = '150px';
|
|
540
|
-
} else {
|
|
541
|
-
fbSp.appendChild(EL('p', {
|
|
542
|
-
className: 'muted',
|
|
543
|
-
style: 'padding:32px;text-align:center;font-size:13px',
|
|
544
|
-
text: 'No recall history is available yet.',
|
|
545
|
-
}));
|
|
546
|
-
}
|
|
547
|
-
fbB.appendChild(fbSp);
|
|
548
|
-
fbCard.appendChild(fbB);
|
|
549
|
-
grid.appendChild(fbCard);
|
|
550
|
-
|
|
551
|
-
// Settled reward distribution
|
|
552
|
-
var outCard = EL('div', { className: 'card' });
|
|
553
|
-
var outH = EL('div', { className: 'card-head' });
|
|
554
|
-
outH.appendChild(EL('h3', { text: 'Reward distribution' }));
|
|
555
|
-
outH.appendChild(EL('span', { className: 'sub', text: 'based on how you engage with recalled results' }));
|
|
556
|
-
outCard.appendChild(outH);
|
|
557
|
-
var outB = EL('div', { className: 'card-pad', id: 'od-brain-outcomes' });
|
|
558
|
-
if (total === 0 || isUnmeasuredPrior) {
|
|
559
|
-
outB.appendChild(EL('p', {
|
|
560
|
-
className: 'muted',
|
|
561
|
-
style: 'padding:16px;text-align:center;font-size:13px',
|
|
562
|
-
text: total === 0
|
|
563
|
-
? 'No reward labels yet. Recall engagement will populate this view.'
|
|
564
|
-
: 'All ' + fmtNum(total) + ' labels carry the default score. ' +
|
|
565
|
-
'Differentiated results appear after consistent recall use.',
|
|
566
|
-
}));
|
|
567
|
-
} else {
|
|
568
|
-
[
|
|
569
|
-
['Positive (> 0.6)', bd.positive || 0, 'var(--ok)'],
|
|
570
|
-
['Neutral (0.4–0.6)', bd.neutral || 0, 'var(--cyan)'],
|
|
571
|
-
['Negative (< 0.4)', bd.negative || 0, 'var(--danger)'],
|
|
572
|
-
].forEach(function (r) {
|
|
573
|
-
var p2 = Math.round(r[1] / total * 100);
|
|
574
|
-
var rw = EL('div', { style: 'margin-bottom:13px' });
|
|
575
|
-
var rm = EL('div', {
|
|
576
|
-
style: 'display:flex;justify-content:space-between;font-size:13px;margin-bottom:6px',
|
|
577
|
-
});
|
|
578
|
-
rm.appendChild(EL('span', { text: r[0] }));
|
|
579
|
-
rm.appendChild(EL('b', { className: 'num', text: p2 + '%' }));
|
|
580
|
-
rw.appendChild(rm);
|
|
581
|
-
rw.appendChild(meter(p2, r[2]));
|
|
582
|
-
outB.appendChild(rw);
|
|
583
|
-
});
|
|
584
|
-
}
|
|
585
|
-
outCard.appendChild(outB);
|
|
586
|
-
grid.appendChild(outCard);
|
|
587
|
-
sec.appendChild(grid);
|
|
588
|
-
return sec;
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
// ======================================================================
|
|
592
|
-
// Tab: BEHAVIOUR
|
|
593
|
-
// ======================================================================
|
|
594
|
-
function buildBehaviour(learning, behavioral) {
|
|
595
|
-
var sec = EL('section', { className: 'tabpane', 'data-p': 'behaviour' });
|
|
596
|
-
var l = learning || {};
|
|
597
|
-
var beh = behavioral || {};
|
|
598
|
-
var grid1 = EL('div', { className: 'grid', style: 'grid-template-columns:1fr 1fr;align-items:start' });
|
|
599
|
-
|
|
600
|
-
// Tech preferences table
|
|
601
|
-
var tc = EL('div', { className: 'card' });
|
|
602
|
-
var tch = EL('div', { className: 'card-head' });
|
|
603
|
-
tch.appendChild(EL('h3', { text: 'Tech preferences' }));
|
|
604
|
-
tch.appendChild(EL('span', { className: 'sub', text: 'your tools and technology preferences' }));
|
|
605
|
-
tc.appendChild(tch);
|
|
606
|
-
var tcb = EL('div', { className: 'card-pad' });
|
|
607
|
-
var techItems = l.tech_preferences || [];
|
|
608
|
-
if (techItems.length === 0) {
|
|
609
|
-
tcb.appendChild(EL('p', {
|
|
610
|
-
className: 'muted',
|
|
611
|
-
style: 'padding:16px;text-align:center;font-size:13px',
|
|
612
|
-
text: 'No tech preferences learned yet. These emerge after consistent cross-session usage.',
|
|
613
|
-
}));
|
|
614
|
-
} else {
|
|
615
|
-
var tbl = EL('table', { className: 'tbl' });
|
|
616
|
-
var thead = EL('thead');
|
|
617
|
-
var thr = EL('tr');
|
|
618
|
-
['Preference', 'Value', 'Confidence', 'Evidence'].forEach(function (h) {
|
|
619
|
-
thr.appendChild(EL('th', { text: h }));
|
|
620
|
-
});
|
|
621
|
-
thead.appendChild(thr); tbl.appendChild(thead);
|
|
622
|
-
var tbody = EL('tbody');
|
|
623
|
-
techItems.slice(0, 10).forEach(function (t) {
|
|
624
|
-
var tr = EL('tr');
|
|
625
|
-
tr.appendChild(EL('td', { className: 'muted', text: String(t.name || t.preference || '—') }));
|
|
626
|
-
var vd = EL('td');
|
|
627
|
-
vd.appendChild(EL('b', { text: String(t.value || '—') }));
|
|
628
|
-
tr.appendChild(vd);
|
|
629
|
-
var cp = Math.round(Number(t.confidence || t.strength || 0) * 100);
|
|
630
|
-
var cd = EL('td');
|
|
631
|
-
cd.appendChild(inlineBar(cp));
|
|
632
|
-
cd.appendChild(document.createTextNode(cp + '%'));
|
|
633
|
-
tr.appendChild(cd);
|
|
634
|
-
tr.appendChild(EL('td', { className: 'num', text: String(t.evidence_count || t.count || 0) }));
|
|
635
|
-
tbody.appendChild(tr);
|
|
636
|
-
});
|
|
637
|
-
tbl.appendChild(tbody); tcb.appendChild(tbl);
|
|
638
|
-
}
|
|
639
|
-
tc.appendChild(tcb); grid1.appendChild(tc);
|
|
640
|
-
|
|
641
|
-
// Workflow patterns
|
|
642
|
-
var wc = EL('div', { className: 'card' });
|
|
643
|
-
var wch = EL('div', { className: 'card-head' });
|
|
644
|
-
wch.appendChild(EL('h3', { text: 'Workflow patterns' }));
|
|
645
|
-
wch.appendChild(EL('span', { className: 'sub', text: 'how you sequence your work over time' }));
|
|
646
|
-
wc.appendChild(wch);
|
|
647
|
-
var wcb = EL('div', { className: 'card-pad' });
|
|
648
|
-
var wfPats = l.workflow_patterns || [];
|
|
649
|
-
if (wfPats.length === 0) {
|
|
650
|
-
wcb.appendChild(EL('p', {
|
|
651
|
-
className: 'muted',
|
|
652
|
-
style: 'padding:16px;text-align:center;font-size:13px',
|
|
653
|
-
text: 'No sequence or temporal patterns recorded yet. Interest signals are not shown as workflows.',
|
|
654
|
-
}));
|
|
655
|
-
} else {
|
|
656
|
-
wfPats.slice(0, 3).forEach(function (wf) {
|
|
657
|
-
var wd = EL('div', { style: 'margin-top:12px' });
|
|
658
|
-
wd.appendChild(EL('span', { className: 'badge violet', text: String(wf.type || 'pattern') }));
|
|
659
|
-
wd.appendChild(EL('div', {
|
|
660
|
-
style: 'margin-top:6px;font-size:13px',
|
|
661
|
-
text: String(wf.description || wf.pattern || '—'),
|
|
662
|
-
}));
|
|
663
|
-
wcb.appendChild(wd);
|
|
664
|
-
});
|
|
665
|
-
}
|
|
666
|
-
wc.appendChild(wcb); grid1.appendChild(wc);
|
|
667
|
-
sec.appendChild(grid1);
|
|
668
|
-
|
|
669
|
-
var grid2 = EL('div', {
|
|
670
|
-
className: 'grid',
|
|
671
|
-
style: 'grid-template-columns:1fr 1fr;align-items:start;margin-top:16px',
|
|
672
|
-
});
|
|
673
|
-
|
|
674
|
-
// Cross-project transfers
|
|
675
|
-
var xc = EL('div', { className: 'card' });
|
|
676
|
-
var xch = EL('div', { className: 'card-head' });
|
|
677
|
-
xch.appendChild(EL('h3', { text: 'Cross-project transfers' }));
|
|
678
|
-
xch.appendChild(EL('span', { className: 'sub', text: 'patterns reused across projects' }));
|
|
679
|
-
xc.appendChild(xch);
|
|
680
|
-
var xcb = EL('div', { className: 'card-pad' });
|
|
681
|
-
var xPats = beh.cross_project_patterns || [];
|
|
682
|
-
if (xPats.length === 0) {
|
|
683
|
-
xcb.appendChild(EL('p', {
|
|
684
|
-
className: 'muted',
|
|
685
|
-
style: 'padding:16px;text-align:center;font-size:13px',
|
|
686
|
-
text: 'No cross-project patterns yet. These appear when the same behaviour is detected in 2+ projects.',
|
|
687
|
-
}));
|
|
688
|
-
} else {
|
|
689
|
-
xPats.slice(0, 5).forEach(function (x) {
|
|
690
|
-
var item = EL('div', { className: 'feed-item' });
|
|
691
|
-
if (typeof window.slmIcon === 'function') {
|
|
692
|
-
var ic = EL('span', { className: 'ic', style: 'background:var(--violet-soft);color:var(--violet)' });
|
|
693
|
-
ic.innerHTML = window.slmIcon('link');
|
|
694
|
-
item.appendChild(ic);
|
|
695
|
-
}
|
|
696
|
-
var info = EL('div');
|
|
697
|
-
info.appendChild(EL('b', { text: String(x.pattern_key || x.name || '—') }));
|
|
698
|
-
info.appendChild(EL('div', {
|
|
699
|
-
className: 'dim',
|
|
700
|
-
style: 'font-size:12px;margin-top:2px',
|
|
701
|
-
text: String(x.description || x.pattern_type || '—'),
|
|
702
|
-
}));
|
|
703
|
-
item.appendChild(info); xcb.appendChild(item);
|
|
704
|
-
});
|
|
705
|
-
}
|
|
706
|
-
xc.appendChild(xcb); grid2.appendChild(xc);
|
|
707
|
-
|
|
708
|
-
// Recent outcomes
|
|
709
|
-
var rc = EL('div', { className: 'card' });
|
|
710
|
-
var rch = EL('div', { className: 'card-head' });
|
|
711
|
-
rch.appendChild(EL('h3', { text: 'Recent outcomes' }));
|
|
712
|
-
rc.appendChild(rch);
|
|
713
|
-
var rcb = EL('div', { className: 'card-pad' });
|
|
714
|
-
var recOuts = beh.recent_outcomes || [];
|
|
715
|
-
if (recOuts.length === 0) {
|
|
716
|
-
rcb.appendChild(EL('p', {
|
|
717
|
-
className: 'muted',
|
|
718
|
-
style: 'padding:16px;text-align:center;font-size:13px',
|
|
719
|
-
text: 'No outcome reports yet. Use /report-outcome to teach the ranker.',
|
|
720
|
-
}));
|
|
721
|
-
} else {
|
|
722
|
-
recOuts.slice(0, 8).forEach(function (r) {
|
|
723
|
-
var item = EL('div', { className: 'feed-item' });
|
|
724
|
-
var out = String(r.outcome || 'unknown');
|
|
725
|
-
var bcls = out === 'success' ? 'ok' : out === 'failure' ? 'danger' : 'warn';
|
|
726
|
-
var bdg = EL('span', { className: 'badge ' + bcls });
|
|
727
|
-
bdg.appendChild(EL('span', { className: 'dot' }));
|
|
728
|
-
bdg.appendChild(document.createTextNode(' ' + out));
|
|
729
|
-
item.appendChild(bdg);
|
|
730
|
-
item.appendChild(EL('span', {
|
|
731
|
-
style: 'flex:1;font-size:13px',
|
|
732
|
-
text: String(r.action_type || 'other'),
|
|
733
|
-
}));
|
|
734
|
-
item.appendChild(EL('time', { text: String(r.timestamp || '') }));
|
|
735
|
-
rcb.appendChild(item);
|
|
736
|
-
});
|
|
737
|
-
}
|
|
738
|
-
rc.appendChild(rcb); grid2.appendChild(rc);
|
|
739
|
-
sec.appendChild(grid2);
|
|
740
|
-
return sec;
|
|
741
|
-
}
|
|
742
|
-
|
|
743
|
-
// ======================================================================
|
|
744
|
-
// Tab: CONNECTED CLIENTS
|
|
745
|
-
// ======================================================================
|
|
746
|
-
function fmtSecondsAgo(s) {
|
|
747
|
-
if (s == null) return 'unknown';
|
|
748
|
-
var n = Number(s);
|
|
749
|
-
if (n < 120) return n + 's ago';
|
|
750
|
-
if (n < 7200) return Math.round(n / 60) + 'm ago';
|
|
751
|
-
if (n < 172800) return Math.round(n / 3600) + 'h ago';
|
|
752
|
-
return Math.round(n / 86400) + 'd ago';
|
|
753
|
-
}
|
|
754
|
-
|
|
755
|
-
// buildClients accepts an optional third argument `boundedLoops` (brain.bounded_loops).
|
|
756
|
-
// Absent / undefined is safe: the BL section is silently omitted.
|
|
757
|
-
function buildClients(living, configured, boundedLoops) {
|
|
758
|
-
var sec = EL('section', { className: 'tabpane', 'data-p': 'clients' });
|
|
759
|
-
var connectedData = (living && living.connected_clients) || {};
|
|
760
|
-
var clients = connectedData.clients || [];
|
|
761
|
-
var registryStatus = String(connectedData.registry_status || '');
|
|
762
|
-
var newestAgo = connectedData.newest_entry_seconds_ago;
|
|
763
|
-
var configuredData = configured || {};
|
|
764
|
-
|
|
765
|
-
// ── Recent client activity ────────────────────────────────────────────
|
|
766
|
-
// Activity is presence reported by host lifecycle hooks, not the old
|
|
767
|
-
// tool-event proxy. A configured adapter and a recent client are two
|
|
768
|
-
// different truths, rendered as separate cards.
|
|
769
|
-
var evc = EL('div', { className: 'card', style: 'margin-bottom:16px' });
|
|
770
|
-
var evh = EL('div', { className: 'card-head' });
|
|
771
|
-
evh.appendChild(EL('h3', { text: 'Recent client activity' }));
|
|
772
|
-
evh.appendChild(EL('span', { className: 'sub', text: 'host lifecycle presence · last 5 minutes' }));
|
|
773
|
-
evc.appendChild(evh);
|
|
774
|
-
var evb = EL('div', { className: 'card-pad' });
|
|
775
|
-
|
|
776
|
-
if (registryStatus === 'error' || registryStatus === 'unknown') {
|
|
777
|
-
// Honesty constraint: failure and emptiness must not return the same value.
|
|
778
|
-
// 'unknown' belongs HERE, not in the healthy-empty branch below. The
|
|
779
|
-
// registry reader is fail-soft — a corrupt or unreadable file makes
|
|
780
|
-
// _load() return {} and active_client_summary() return [], so the read
|
|
781
|
-
// model reports status 'unknown' with an empty client list and is_real
|
|
782
|
-
// true. Falling through to "No host activity in the last 5 minutes" would
|
|
783
|
-
// render a BROKEN registry exactly like a healthy quiet machine, which is
|
|
784
|
-
// precisely the silent failure this section was rewritten to eliminate.
|
|
785
|
-
evb.appendChild(EL('p', {
|
|
786
|
-
className: 'muted',
|
|
787
|
-
style: 'padding:16px;text-align:center;font-size:13px',
|
|
788
|
-
text: registryStatus === 'unknown'
|
|
789
|
-
? 'Presence records could not be read, so recent activity cannot be '
|
|
790
|
-
+ 'confirmed. This is not the same as no agents being active.'
|
|
791
|
-
: 'Presence registry unavailable. Check daemon logs for details.',
|
|
792
|
-
}));
|
|
793
|
-
} else if (registryStatus === 'stale') {
|
|
794
|
-
// TELEMETRY GAP — entries exist but all are > 10 min old.
|
|
795
|
-
// "No activity" here would be indistinguishable from "hooks not firing".
|
|
796
|
-
evb.appendChild(EL('p', {
|
|
797
|
-
className: 'muted',
|
|
798
|
-
style: 'padding:16px;text-align:center;font-size:13px',
|
|
799
|
-
text: 'Presence recording gap — last hook event was ' + fmtSecondsAgo(newestAgo) + '. ' +
|
|
800
|
-
'Hooks are installed but presence has not been written recently. ' +
|
|
801
|
-
'Recent activity from integrations cannot be confirmed.',
|
|
802
|
-
}));
|
|
803
|
-
} else if (registryStatus === 'absent' || registryStatus === 'empty') {
|
|
804
|
-
// No records at all — first run or hooks have not fired yet.
|
|
805
|
-
evb.appendChild(EL('p', {
|
|
806
|
-
className: 'muted',
|
|
807
|
-
style: 'padding:16px;text-align:center;font-size:13px',
|
|
808
|
-
text: 'No presence records found. Hook events may not have fired yet on this install.',
|
|
809
|
-
}));
|
|
810
|
-
} else if (clients.length === 0) {
|
|
811
|
-
// Registry is live (recent writes) but no clients in the 5-min window.
|
|
812
|
-
evb.appendChild(EL('p', {
|
|
813
|
-
className: 'muted',
|
|
814
|
-
style: 'padding:16px;text-align:center;font-size:13px',
|
|
815
|
-
text: 'No host activity in the last 5 minutes. This does not mean an integration is uninstalled.',
|
|
816
|
-
}));
|
|
817
|
-
} else {
|
|
818
|
-
clients.forEach(function (client) {
|
|
819
|
-
var row = EL('div', { className: 'list-row' });
|
|
820
|
-
row.appendChild(EL('b', { style: 'flex:1', text: String(client.kind || 'other') }));
|
|
821
|
-
row.appendChild(EL('span', { className: 'muted',
|
|
822
|
-
text: 'active ' + fmtSecondsAgo(client.last_seen_seconds_ago),
|
|
823
|
-
}));
|
|
824
|
-
evb.appendChild(row);
|
|
825
|
-
});
|
|
826
|
-
}
|
|
827
|
-
evc.appendChild(evb);
|
|
828
|
-
sec.appendChild(evc);
|
|
829
|
-
|
|
830
|
-
// ── Configured integrations ───────────────────────────────────────────
|
|
831
|
-
// Installation / sync state, not client activity.
|
|
832
|
-
// For Codex, evidence_tier='configured' means config-file evidence;
|
|
833
|
-
// badge reads 'configured' rather than 'available' to be explicit.
|
|
834
|
-
var tc = EL('div', { className: 'card', style: 'margin-bottom:16px' });
|
|
835
|
-
var tch = EL('div', { className: 'card-head' });
|
|
836
|
-
tch.appendChild(EL('h3', { text: 'Configured integrations' }));
|
|
837
|
-
tch.appendChild(EL('span', { className: 'sub', text: 'installation and sync availability' }));
|
|
838
|
-
tc.appendChild(tch);
|
|
839
|
-
var tcb = EL('div', { className: 'card-pad' });
|
|
840
|
-
Object.keys(configuredData).sort().forEach(function (kind) {
|
|
841
|
-
var state = configuredData[kind] || {};
|
|
842
|
-
var row = EL('div', { className: 'list-row' });
|
|
843
|
-
row.appendChild(EL('span', { style: 'flex:1', text: kind.replace(/_/g, ' ') }));
|
|
844
|
-
var badgeText = state.active
|
|
845
|
-
? (state.evidence_tier === 'configured' ? 'configured' : 'available')
|
|
846
|
-
: (state.reason || 'not available');
|
|
847
|
-
var badgeEl = EL('span', {
|
|
848
|
-
className: 'badge ' + (state.active ? 'ok' : 'warn'),
|
|
849
|
-
text: badgeText,
|
|
850
|
-
});
|
|
851
|
-
if (state.evidence) badgeEl.setAttribute('title', String(state.evidence));
|
|
852
|
-
row.appendChild(badgeEl);
|
|
853
|
-
tcb.appendChild(row);
|
|
854
|
-
});
|
|
855
|
-
tc.appendChild(tcb);
|
|
856
|
-
sec.appendChild(tc);
|
|
857
|
-
|
|
858
|
-
// ── Bounded Loops ─────────────────────────────────────────────────────
|
|
859
|
-
// Section is on when bounded_loops.section_enabled === true.
|
|
860
|
-
// When absent (older API or not installed) the section is silently omitted.
|
|
861
|
-
var bl = boundedLoops || {};
|
|
862
|
-
if (bl.section_enabled) {
|
|
863
|
-
var blc = EL('div', { className: 'card' });
|
|
864
|
-
var blh = EL('div', { className: 'card-head' });
|
|
865
|
-
blh.appendChild(EL('h3', { text: 'Bounded Loops' }));
|
|
866
|
-
blh.appendChild(EL('span', {
|
|
867
|
-
className: 'sub',
|
|
868
|
-
text: 'local installation' + (bl.version ? ' · v' + bl.version : ''),
|
|
869
|
-
}));
|
|
870
|
-
blc.appendChild(blh);
|
|
871
|
-
var blb = EL('div', { className: 'card-pad', style: 'display:flex;flex-direction:column;gap:2px' });
|
|
872
|
-
[
|
|
873
|
-
['Status', 'installed'],
|
|
874
|
-
['Version', bl.version || 'unknown'],
|
|
875
|
-
['Bridge contract', bl.bridge_contract || '—'],
|
|
876
|
-
['Evidence', bl.evidence || bl.evidence_tier || '—'],
|
|
877
|
-
['Note', bl.note || '—'],
|
|
878
|
-
].forEach(function (r) {
|
|
879
|
-
var row = EL('div', { className: 'list-row' });
|
|
880
|
-
row.appendChild(EL('span', { className: 'muted', style: 'flex:1', text: r[0] }));
|
|
881
|
-
row.appendChild(EL('b', { text: String(r[1]) }));
|
|
882
|
-
blb.appendChild(row);
|
|
883
|
-
});
|
|
884
|
-
blc.appendChild(blb);
|
|
885
|
-
sec.appendChild(blc);
|
|
886
|
-
}
|
|
887
|
-
|
|
888
|
-
return sec;
|
|
889
|
-
}
|
|
890
|
-
|
|
891
|
-
// ======================================================================
|
|
892
|
-
// Tab: SOURCE QUALITY
|
|
893
|
-
// ======================================================================
|
|
894
|
-
function buildSourceQuality(learning, living) {
|
|
895
|
-
var sec = EL('section', { className: 'tabpane', 'data-p': 'sources' });
|
|
896
|
-
var scores = (learning && learning.source_scores) || {};
|
|
897
|
-
var entries = Object.keys(scores).sort(function (a, b) {
|
|
898
|
-
return Number(scores[b]) - Number(scores[a]);
|
|
899
|
-
});
|
|
900
|
-
var card = EL('div', { className: 'card' });
|
|
901
|
-
var ch = EL('div', { className: 'card-head' });
|
|
902
|
-
ch.appendChild(EL('h3', { text: 'Source quality' }));
|
|
903
|
-
ch.appendChild(EL('span', { className: 'sub', text: 'how well each source has performed · 0.0–1.0' }));
|
|
904
|
-
card.appendChild(ch);
|
|
905
|
-
var cb = EL('div', { className: 'card-pad' });
|
|
906
|
-
var aggregate = (living && living.source_quality) || {};
|
|
907
|
-
var observedSources = Number(aggregate.observed_sources || 0);
|
|
908
|
-
if (observedSources === 0) {
|
|
909
|
-
cb.appendChild(EL('p', {
|
|
910
|
-
className: 'muted',
|
|
911
|
-
style: 'padding:16px;text-align:center;font-size:13px',
|
|
912
|
-
text: 'No source-quality evidence has settled yet. Recall hits alone do not establish source quality.',
|
|
913
|
-
}));
|
|
914
|
-
} else if (entries.length === 0) {
|
|
915
|
-
cb.appendChild(EL('p', {
|
|
916
|
-
className: 'muted',
|
|
917
|
-
style: 'padding:16px;text-align:center;font-size:13px',
|
|
918
|
-
text: String(observedSources) + ' sources have been seen, but individual quality scores are not available yet.',
|
|
919
|
-
}));
|
|
920
|
-
} else {
|
|
921
|
-
// allAtPrior: every source at exactly 0.50 means the system has not yet accumulated
|
|
922
|
-
// enough outcome data to shift away from the initialization value. Showing 18 identical
|
|
923
|
-
// rows would mislead a non-technical reader into thinking quality was measured.
|
|
924
|
-
var allAtPrior = entries.every(function (k) {
|
|
925
|
-
return Math.abs(Number(scores[k]) - 0.5) < 0.005;
|
|
926
|
-
});
|
|
927
|
-
if (allAtPrior) {
|
|
928
|
-
cb.appendChild(EL('p', {
|
|
929
|
-
className: 'muted',
|
|
930
|
-
style: 'font-size:13px;margin-bottom:16px',
|
|
931
|
-
text: String(observedSources) + ' source' + (observedSources === 1 ? '' : 's') +
|
|
932
|
-
' observed. Quality scores start at 0.5 and shift once recall shows ' +
|
|
933
|
-
'which sources consistently produce better results. No quality signal has settled yet.',
|
|
934
|
-
}));
|
|
935
|
-
} else {
|
|
936
|
-
cb.appendChild(EL('p', {
|
|
937
|
-
className: 'muted',
|
|
938
|
-
style: 'font-size:13px;margin-bottom:16px',
|
|
939
|
-
text: String(observedSources) + ' source' + (observedSources === 1 ? '' : 's') +
|
|
940
|
-
' · average quality ' + Number(aggregate.mean_quality).toFixed(2) + '.',
|
|
941
|
-
}));
|
|
942
|
-
entries.forEach(function (k) {
|
|
943
|
-
var v = Number(scores[k]);
|
|
944
|
-
var displayName = humanizeSource(k);
|
|
945
|
-
var row = EL('div', { style: 'margin-bottom:14px' });
|
|
946
|
-
var meta = EL('div', {
|
|
947
|
-
style: 'display:flex;justify-content:space-between;font-size:13px;margin-bottom:6px',
|
|
948
|
-
});
|
|
949
|
-
meta.appendChild(EL('span', { text: displayName }));
|
|
950
|
-
meta.appendChild(EL('b', { className: 'num', text: v.toFixed(2) }));
|
|
951
|
-
row.appendChild(meta);
|
|
952
|
-
row.appendChild(meter(v * 100));
|
|
953
|
-
cb.appendChild(row);
|
|
954
|
-
});
|
|
955
|
-
}
|
|
956
|
-
}
|
|
957
|
-
card.appendChild(cb); sec.appendChild(card);
|
|
958
|
-
return sec;
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
// ======================================================================
|
|
962
|
-
// Tab row
|
|
963
|
-
// ======================================================================
|
|
964
|
-
function buildTabRow(pCount) {
|
|
965
|
-
var tabDiv = EL('div', { className: 'tabs', id: 'od-brain-tabs' });
|
|
966
|
-
[
|
|
967
|
-
['overview', 'Overview', null],
|
|
968
|
-
['reward', 'Reward signal', null],
|
|
969
|
-
['behaviour', 'Behaviour', pCount],
|
|
970
|
-
['clients', 'Connected clients', null],
|
|
971
|
-
['sources', 'Source quality', null],
|
|
972
|
-
].forEach(function (td, i) {
|
|
973
|
-
var btn = EL('button', { className: 'tab' + (i === 0 ? ' active' : ''), 'data-t': td[0] });
|
|
974
|
-
btn.appendChild(document.createTextNode(td[1]));
|
|
975
|
-
if (td[2] !== null) {
|
|
976
|
-
btn.appendChild(document.createTextNode(' '));
|
|
977
|
-
btn.appendChild(EL('span', { className: 'cnt', text: String(td[2]) }));
|
|
978
|
-
}
|
|
979
|
-
tabDiv.appendChild(btn);
|
|
980
|
-
});
|
|
981
|
-
return tabDiv;
|
|
982
|
-
}
|
|
983
|
-
|
|
984
|
-
// ======================================================================
|
|
985
|
-
// Wire tab switching — addEventListener only (CSP-safe, no onclick)
|
|
986
|
-
// ======================================================================
|
|
987
|
-
function wireTabs(container) {
|
|
988
|
-
var tabRow = container.querySelector('#od-brain-tabs');
|
|
989
|
-
if (!tabRow) return;
|
|
990
|
-
var btns = tabRow.querySelectorAll('.tab');
|
|
991
|
-
btns.forEach(function (btn) {
|
|
992
|
-
btn.addEventListener('click', function () {
|
|
993
|
-
btns.forEach(function (b) { b.classList.remove('active'); });
|
|
994
|
-
btn.classList.add('active');
|
|
995
|
-
var t = btn.getAttribute('data-t');
|
|
996
|
-
container.querySelectorAll('.tabpane').forEach(function (s) {
|
|
997
|
-
s.classList.toggle('active', s.getAttribute('data-p') === t);
|
|
998
|
-
});
|
|
999
|
-
});
|
|
1000
|
-
});
|
|
1001
|
-
}
|
|
1002
|
-
|
|
1003
|
-
// ======================================================================
|
|
1004
|
-
// Loading / error
|
|
1005
|
-
// ======================================================================
|
|
1006
|
-
function showLoading(container) {
|
|
1007
|
-
container.replaceChildren();
|
|
1008
|
-
var w = EL('div', { style: 'padding:32px;text-align:center' });
|
|
1009
|
-
var spin = EL('div', { className: 'spinner-border text-primary', role: 'status' });
|
|
1010
|
-
spin.appendChild(EL('span', { className: 'visually-hidden', text: 'Loading' }));
|
|
1011
|
-
w.appendChild(spin);
|
|
1012
|
-
w.appendChild(EL('span', { className: 'text-muted ms-2', text: ' Loading Brain…' }));
|
|
1013
|
-
container.appendChild(w);
|
|
1014
|
-
}
|
|
1015
|
-
|
|
1016
|
-
function showError(container, err) {
|
|
1017
|
-
container.replaceChildren();
|
|
1018
|
-
var w = EL('div', { style: 'padding:24px' });
|
|
1019
|
-
w.appendChild(EL('p', { className: 'text-danger fw-bold', text: 'Could not load Brain data.' }));
|
|
1020
|
-
w.appendChild(EL('p', {
|
|
1021
|
-
className: 'text-muted',
|
|
1022
|
-
text: 'The daemon may be starting up. Details in the browser console.',
|
|
1023
|
-
}));
|
|
1024
|
-
var btn = EL('button', {
|
|
1025
|
-
className: 'btn btn-sm btn-outline-secondary',
|
|
1026
|
-
type: 'button',
|
|
1027
|
-
text: 'Retry',
|
|
1028
|
-
});
|
|
1029
|
-
btn.addEventListener('click', function () { render(container); });
|
|
1030
|
-
w.appendChild(btn);
|
|
1031
|
-
container.appendChild(w);
|
|
1032
|
-
if (err && window.console) window.console.debug('[od-brain]', err.message || String(err));
|
|
1033
|
-
}
|
|
1034
|
-
|
|
1035
|
-
// ======================================================================
|
|
1036
|
-
// Main render
|
|
1037
|
-
// ======================================================================
|
|
1038
|
-
function render(container) {
|
|
1039
|
-
showLoading(container);
|
|
1040
|
-
injectPhaseStyle();
|
|
1041
|
-
fetchAll().then(function (results) {
|
|
1042
|
-
var learning = results[0] || {};
|
|
1043
|
-
var behavioral = results[1] || {};
|
|
1044
|
-
var events = ((results[3] && results[3].events) || []);
|
|
1045
|
-
var brain = results[4] || {};
|
|
1046
|
-
var living = brain.living_brain || {};
|
|
1047
|
-
var dateMap = buildDateMap(events);
|
|
1048
|
-
var pCount = ((behavioral.patterns) || []).length;
|
|
1049
|
-
|
|
1050
|
-
var head = EL('div', { className: 'page-head' });
|
|
1051
|
-
head.appendChild(EL('h2', { text: 'The living brain' }));
|
|
1052
|
-
head.appendChild(EL('p', {
|
|
1053
|
-
text: 'A local view of memory activity, feedback, and evidence. Observations are shown separately ' +
|
|
1054
|
-
'from ranking and do not change recall, ranking, or model routing by themselves.',
|
|
1055
|
-
}));
|
|
1056
|
-
|
|
1057
|
-
container.replaceChildren(
|
|
1058
|
-
head,
|
|
1059
|
-
buildTabRow(pCount),
|
|
1060
|
-
buildOverview(learning, behavioral, dateMap, living),
|
|
1061
|
-
buildReward(behavioral),
|
|
1062
|
-
buildBehaviour(learning, behavioral),
|
|
1063
|
-
buildClients(living, brain.cross_platform, brain.bounded_loops),
|
|
1064
|
-
buildSourceQuality(learning, living)
|
|
1065
|
-
);
|
|
1066
|
-
wireTabs(container);
|
|
1067
|
-
}).catch(function (err) { showError(container, err); });
|
|
1068
|
-
}
|
|
1069
|
-
|
|
1070
|
-
// ======================================================================
|
|
1071
|
-
// Public API — od-shell.js calls window.odRenderBrain(pane)
|
|
1072
|
-
// ======================================================================
|
|
1073
|
-
window.odRenderBrain = function (container) { if (container) render(container); };
|
|
1074
|
-
|
|
1075
|
-
// Legacy compatibility — ng-shell.js calls window.loadBrain()
|
|
1076
|
-
window.loadBrain = function () {
|
|
1077
|
-
var c = document.getElementById('brain-pane');
|
|
1078
|
-
if (c) render(c);
|
|
1079
|
-
};
|
|
1080
|
-
|
|
1081
|
-
// Auto-boot when the pane is already visible (e.g., deep-link to #brain-pane)
|
|
1082
|
-
(function boot() {
|
|
1083
|
-
function tryBoot() {
|
|
1084
|
-
var c = document.getElementById('brain-pane');
|
|
1085
|
-
if (!c) return;
|
|
1086
|
-
if (c.classList.contains('active') || c.classList.contains('show')) render(c);
|
|
1087
|
-
}
|
|
1088
|
-
if (document.readyState === 'loading') {
|
|
1089
|
-
document.addEventListener('DOMContentLoaded', tryBoot);
|
|
1090
|
-
} else {
|
|
1091
|
-
tryBoot();
|
|
1092
|
-
}
|
|
1093
|
-
}());
|
|
1094
|
-
|
|
1095
|
-
}());
|