superlocalmemory 3.3.3__tar.gz → 3.3.7__tar.gz
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.
- {superlocalmemory-3.3.3/src/superlocalmemory.egg-info → superlocalmemory-3.3.7}/PKG-INFO +3 -2
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/README.md +2 -1
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/pyproject.toml +5 -1
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/cli/commands.py +150 -13
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/cli/main.py +25 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/core/config.py +12 -9
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/core/embedding_worker.py +27 -1
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/core/embeddings.py +39 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/core/recall_worker.py +26 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/core/worker_pool.py +9 -2
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/encoding/cognitive_consolidator.py +19 -1
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/encoding/emotional.py +5 -2
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/encoding/entity_resolver.py +1 -1
- superlocalmemory-3.3.7/src/superlocalmemory/hooks/claude_code_hooks.py +404 -0
- superlocalmemory-3.3.7/src/superlocalmemory/hooks/hook_handlers.py +394 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/math/polar_quant.py +3 -1
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/retrieval/engine.py +36 -8
- superlocalmemory-3.3.7/src/superlocalmemory/retrieval/reranker.py +371 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/storage/embedding_migrator.py +4 -3
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7/src/superlocalmemory.egg-info}/PKG-INFO +3 -2
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory.egg-info/SOURCES.txt +3 -0
- superlocalmemory-3.3.7/tests/test_claude_hooks.py +792 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/tests/test_cli_v33.py +3 -2
- superlocalmemory-3.3.7/tests/test_hook_handlers.py +991 -0
- superlocalmemory-3.3.3/src/superlocalmemory/hooks/claude_code_hooks.py +0 -175
- superlocalmemory-3.3.3/src/superlocalmemory/retrieval/reranker.py +0 -255
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/AUTHORS.md +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/LICENSE +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/NOTICE +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/setup.cfg +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/__init__.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/attribution/__init__.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/attribution/mathematical_dna.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/attribution/signer.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/attribution/watermark.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/cli/__init__.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/cli/json_output.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/cli/migrate_cmd.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/cli/post_install.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/cli/setup_wizard.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/compliance/__init__.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/compliance/abac.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/compliance/audit.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/compliance/eu_ai_act.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/compliance/gdpr.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/compliance/lifecycle.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/compliance/retention.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/compliance/scheduler.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/core/__init__.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/core/consolidation_engine.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/core/engine.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/core/engine_wiring.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/core/graph_analyzer.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/core/hooks.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/core/maintenance.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/core/modes.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/core/ollama_embedder.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/core/profiles.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/core/recall_pipeline.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/core/registry.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/core/store_pipeline.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/core/summarizer.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/dynamics/__init__.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/dynamics/activation_guided_quantization.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/dynamics/eap_scheduler.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/dynamics/ebbinghaus_langevin_coupling.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/dynamics/fisher_langevin_coupling.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/encoding/__init__.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/encoding/auto_linker.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/encoding/consolidator.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/encoding/context_generator.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/encoding/entropy_gate.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/encoding/fact_extractor.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/encoding/foresight.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/encoding/graph_builder.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/encoding/observation_builder.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/encoding/scene_builder.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/encoding/signal_inference.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/encoding/temporal_parser.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/encoding/temporal_validator.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/encoding/type_router.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/hooks/__init__.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/hooks/auto_capture.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/hooks/auto_invoker.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/hooks/auto_parameterize.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/hooks/auto_recall.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/hooks/ide_connector.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/hooks/rules_engine.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/infra/__init__.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/infra/auth_middleware.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/infra/backup.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/infra/cache_manager.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/infra/event_bus.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/infra/heartbeat_monitor.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/infra/pid_manager.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/infra/process_reaper.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/infra/rate_limiter.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/infra/webhook_dispatcher.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/learning/__init__.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/learning/adaptive.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/learning/behavioral.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/learning/behavioral_listener.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/learning/bootstrap.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/learning/consolidation_quantization_worker.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/learning/consolidation_worker.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/learning/cross_project.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/learning/database.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/learning/engagement.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/learning/features.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/learning/feedback.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/learning/forgetting_scheduler.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/learning/outcomes.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/learning/project_context.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/learning/quantization_scheduler.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/learning/ranker.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/learning/signals.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/learning/source_quality.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/learning/workflows.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/llm/__init__.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/llm/backbone.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/math/__init__.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/math/ebbinghaus.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/math/fisher.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/math/fisher_quantized.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/math/hopfield.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/math/langevin.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/math/qjl.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/math/sheaf.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/mcp/__init__.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/mcp/resources.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/mcp/server.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/mcp/tools.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/mcp/tools_active.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/mcp/tools_core.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/mcp/tools_v28.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/mcp/tools_v3.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/mcp/tools_v33.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/parameterization/__init__.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/parameterization/pattern_extractor.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/parameterization/pii_filter.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/parameterization/prompt_injector.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/parameterization/prompt_lifecycle.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/parameterization/soft_prompt_generator.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/retrieval/__init__.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/retrieval/agentic.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/retrieval/ann_index.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/retrieval/bm25_channel.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/retrieval/bridge_discovery.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/retrieval/channel_registry.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/retrieval/entity_channel.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/retrieval/forgetting_filter.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/retrieval/fusion.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/retrieval/hopfield_channel.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/retrieval/profile_channel.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/retrieval/quantization_aware_search.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/retrieval/semantic_channel.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/retrieval/spreading_activation.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/retrieval/strategy.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/retrieval/temporal_channel.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/retrieval/vector_store.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/server/__init__.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/server/api.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/server/routes/__init__.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/server/routes/agents.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/server/routes/backup.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/server/routes/behavioral.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/server/routes/compliance.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/server/routes/data_io.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/server/routes/events.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/server/routes/helpers.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/server/routes/learning.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/server/routes/lifecycle.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/server/routes/memories.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/server/routes/profiles.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/server/routes/stats.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/server/routes/v3_api.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/server/routes/ws.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/server/security_middleware.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/server/ui.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/storage/__init__.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/storage/access_control.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/storage/access_log.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/storage/database.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/storage/migration_v33.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/storage/migrations.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/storage/models.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/storage/quantized_store.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/storage/schema.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/storage/schema_v32.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/storage/v2_migrator.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/trust/__init__.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/trust/gate.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/trust/provenance.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/trust/scorer.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/trust/signals.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory.egg-info/dependency_links.txt +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory.egg-info/entry_points.txt +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory.egg-info/requires.txt +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory.egg-info/top_level.txt +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/tests/test_auto_hooks.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/tests/test_behavioral_full.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/tests/test_cli.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/tests/test_cli_json.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/tests/test_compliance_full.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/tests/test_config_system.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/tests/test_engine_hooks.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/tests/test_event_bus.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/tests/test_features.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/tests/test_final_locomo_mini.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/tests/test_ide_connector.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/tests/test_infra.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/tests/test_learning_advanced.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/tests/test_learning_collectors.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/tests/test_llm_provider.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/tests/test_mcp_server.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/tests/test_migration.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/tests/test_post_install.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/tests/test_ranker.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/tests/test_trust_full.py +0 -0
- {superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/tests/test_v3_api.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: superlocalmemory
|
|
3
|
-
Version: 3.3.
|
|
3
|
+
Version: 3.3.7
|
|
4
4
|
Summary: Information-geometric agent memory with mathematical guarantees
|
|
5
5
|
Author-email: Varun Pratap Bhardwaj <admin@superlocalmemory.com>
|
|
6
6
|
License: MIT
|
|
@@ -72,7 +72,8 @@ Dynamic: license-file
|
|
|
72
72
|
</p>
|
|
73
73
|
|
|
74
74
|
<h1 align="center">SuperLocalMemory V3.3</h1>
|
|
75
|
-
<p align="center"><strong>
|
|
75
|
+
<p align="center"><strong>Every other AI forgets. Yours won't.</strong><br/><em>Infinite memory for Claude Code, Cursor, Windsurf & 17+ AI tools.</em></p>
|
|
76
|
+
<p align="center"><code>v3.3.6</code> — Install once. Every session remembers the last. Automatically.</p>
|
|
76
77
|
|
|
77
78
|
<p align="center">
|
|
78
79
|
<code>+16pp vs Mem0 (zero cloud)</code> · <code>85% Open-Domain (best of any system)</code> · <code>EU AI Act Ready</code>
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<h1 align="center">SuperLocalMemory V3.3</h1>
|
|
6
|
-
<p align="center"><strong>
|
|
6
|
+
<p align="center"><strong>Every other AI forgets. Yours won't.</strong><br/><em>Infinite memory for Claude Code, Cursor, Windsurf & 17+ AI tools.</em></p>
|
|
7
|
+
<p align="center"><code>v3.3.6</code> — Install once. Every session remembers the last. Automatically.</p>
|
|
7
8
|
|
|
8
9
|
<p align="center">
|
|
9
10
|
<code>+16pp vs Mem0 (zero cloud)</code> · <code>85% Open-Domain (best of any system)</code> · <code>EU AI Act Ready</code>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "superlocalmemory"
|
|
3
|
-
version = "3.3.
|
|
3
|
+
version = "3.3.7"
|
|
4
4
|
description = "Information-geometric agent memory with mathematical guarantees"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = {text = "MIT"}
|
|
@@ -98,6 +98,10 @@ testpaths = ["tests"]
|
|
|
98
98
|
pythonpath = ["src"]
|
|
99
99
|
markers = [
|
|
100
100
|
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
|
|
101
|
+
"ollama: marks tests that require a running Ollama instance",
|
|
102
|
+
]
|
|
103
|
+
filterwarnings = [
|
|
104
|
+
"ignore::DeprecationWarning:vaderSentiment",
|
|
101
105
|
]
|
|
102
106
|
|
|
103
107
|
[tool.coverage.run]
|
|
@@ -18,7 +18,16 @@ from argparse import Namespace
|
|
|
18
18
|
|
|
19
19
|
def dispatch(args: Namespace) -> None:
|
|
20
20
|
"""Route CLI command to the appropriate handler."""
|
|
21
|
+
# Auto-install/upgrade hooks on version change (single file read, ~0.1ms)
|
|
22
|
+
if args.command not in ("hooks", "init", "mcp"):
|
|
23
|
+
try:
|
|
24
|
+
from superlocalmemory.hooks.claude_code_hooks import auto_install_if_needed
|
|
25
|
+
auto_install_if_needed()
|
|
26
|
+
except Exception:
|
|
27
|
+
pass
|
|
28
|
+
|
|
21
29
|
handlers = {
|
|
30
|
+
"init": cmd_init,
|
|
22
31
|
"setup": cmd_setup,
|
|
23
32
|
"mode": cmd_mode,
|
|
24
33
|
"provider": cmd_provider,
|
|
@@ -113,6 +122,10 @@ def cmd_mode(args: Namespace) -> None:
|
|
|
113
122
|
if (config.embedding.provider != updated.embedding.provider
|
|
114
123
|
or config.embedding.model_name != updated.embedding.model_name):
|
|
115
124
|
print(" ⚠ Embedding model changed. Re-indexing will run on next recall.")
|
|
125
|
+
|
|
126
|
+
# V3.3.4: Warn if Mode C lacks cloud API key
|
|
127
|
+
if args.value == "c" and not updated.llm.api_key:
|
|
128
|
+
print(" ⚠ Mode C requires a cloud API key. Run: slm provider set")
|
|
116
129
|
else:
|
|
117
130
|
print(f"Current mode: {config.mode.value.upper()}")
|
|
118
131
|
|
|
@@ -356,12 +369,20 @@ def cmd_forget(args: Namespace) -> None:
|
|
|
356
369
|
sys.exit(1)
|
|
357
370
|
raise
|
|
358
371
|
|
|
372
|
+
dry_run = getattr(args, 'dry_run', False)
|
|
373
|
+
|
|
359
374
|
if use_json:
|
|
360
375
|
from superlocalmemory.cli.json_output import json_print
|
|
361
376
|
if not matches:
|
|
362
377
|
json_print("forget", data={"matched_count": 0, "deleted_count": 0, "matches": []})
|
|
363
378
|
return
|
|
364
379
|
match_items = [{"fact_id": f.fact_id, "content": f.content[:120]} for f in matches[:20]]
|
|
380
|
+
if dry_run:
|
|
381
|
+
json_print("forget", data={
|
|
382
|
+
"matched_count": len(matches), "deleted_count": 0,
|
|
383
|
+
"dry_run": True, "matches": match_items,
|
|
384
|
+
})
|
|
385
|
+
return
|
|
365
386
|
if getattr(args, 'yes', False):
|
|
366
387
|
for f in matches:
|
|
367
388
|
engine._db.delete_fact(f.fact_id)
|
|
@@ -387,6 +408,9 @@ def cmd_forget(args: Namespace) -> None:
|
|
|
387
408
|
print(f"Found {len(matches)} matching memories:")
|
|
388
409
|
for f in matches[:10]:
|
|
389
410
|
print(f" - {f.fact_id[:8]}... {f.content[:80]}")
|
|
411
|
+
if dry_run:
|
|
412
|
+
print(f"(dry run — {len(matches)} would be deleted)")
|
|
413
|
+
return
|
|
390
414
|
if getattr(args, 'yes', False):
|
|
391
415
|
for f in matches:
|
|
392
416
|
engine._db.delete_fact(f.fact_id)
|
|
@@ -861,7 +885,8 @@ def cmd_trace(args: Namespace) -> None:
|
|
|
861
885
|
try:
|
|
862
886
|
config = SLMConfig.load()
|
|
863
887
|
engine = MemoryEngine(config)
|
|
864
|
-
|
|
888
|
+
limit = getattr(args, 'limit', 10)
|
|
889
|
+
response = engine.recall(args.query, limit=limit)
|
|
865
890
|
except Exception as exc:
|
|
866
891
|
if use_json:
|
|
867
892
|
from superlocalmemory.cli.json_output import json_print
|
|
@@ -907,6 +932,14 @@ def cmd_trace(args: Namespace) -> None:
|
|
|
907
932
|
|
|
908
933
|
def cmd_mcp(_args: Namespace) -> None:
|
|
909
934
|
"""Start the V3 MCP server (stdio transport for IDE integration)."""
|
|
935
|
+
# Auto-install hooks on MCP startup (fast path: ~0.1ms if already current)
|
|
936
|
+
# CRITICAL: No stdout — MCP uses stdio transport, any print corrupts protocol
|
|
937
|
+
try:
|
|
938
|
+
from superlocalmemory.hooks.claude_code_hooks import auto_install_if_needed
|
|
939
|
+
auto_install_if_needed()
|
|
940
|
+
except Exception:
|
|
941
|
+
pass
|
|
942
|
+
|
|
910
943
|
from superlocalmemory.mcp.server import server
|
|
911
944
|
|
|
912
945
|
server.run(transport="stdio")
|
|
@@ -1126,6 +1159,99 @@ def cmd_profile(args: Namespace) -> None:
|
|
|
1126
1159
|
# -- Active Memory commands (V3.1) ------------------------------------------
|
|
1127
1160
|
|
|
1128
1161
|
|
|
1162
|
+
def cmd_init(args: Namespace) -> None:
|
|
1163
|
+
"""One-command setup: mode + hooks + IDE connect + warmup."""
|
|
1164
|
+
from pathlib import Path
|
|
1165
|
+
from superlocalmemory.core.config import SLMConfig
|
|
1166
|
+
|
|
1167
|
+
force = getattr(args, "force", False)
|
|
1168
|
+
|
|
1169
|
+
config_exists = (Path.home() / ".superlocalmemory" / "config.json").exists()
|
|
1170
|
+
|
|
1171
|
+
print()
|
|
1172
|
+
print("SuperLocalMemory — One-Time Setup")
|
|
1173
|
+
print("=" * 40)
|
|
1174
|
+
|
|
1175
|
+
# Step 1: Mode selection (interactive)
|
|
1176
|
+
if force or not config_exists:
|
|
1177
|
+
print()
|
|
1178
|
+
from superlocalmemory.cli.setup_wizard import run_wizard
|
|
1179
|
+
run_wizard()
|
|
1180
|
+
else:
|
|
1181
|
+
config = SLMConfig.load()
|
|
1182
|
+
print(f"\n Already configured: Mode {config.mode.value.upper()}")
|
|
1183
|
+
print(f" Profile: {config.active_profile}")
|
|
1184
|
+
|
|
1185
|
+
# Step 2: Install hooks (gate always OFF by default)
|
|
1186
|
+
print()
|
|
1187
|
+
print("Installing Claude Code hooks...")
|
|
1188
|
+
from superlocalmemory.hooks.claude_code_hooks import install_hooks, check_status
|
|
1189
|
+
|
|
1190
|
+
status = check_status()
|
|
1191
|
+
|
|
1192
|
+
if status["installed"] and not force:
|
|
1193
|
+
if status["needs_upgrade"]:
|
|
1194
|
+
from superlocalmemory.hooks.claude_code_hooks import upgrade_hooks
|
|
1195
|
+
result = upgrade_hooks()
|
|
1196
|
+
if result.get("upgraded"):
|
|
1197
|
+
print(f" Hooks upgraded: {result['from_version']} -> {result['to_version']}")
|
|
1198
|
+
else:
|
|
1199
|
+
print(f" Upgrade issue: {result.get('reason', result.get('errors', ''))}")
|
|
1200
|
+
else:
|
|
1201
|
+
print(f" Hooks already installed (v{status['version']})")
|
|
1202
|
+
else:
|
|
1203
|
+
result = install_hooks(include_gate=False)
|
|
1204
|
+
if result["success"]:
|
|
1205
|
+
print(f" Hooks installed: {', '.join(result['hooks_added'])}")
|
|
1206
|
+
print(" SLM: Hooks installed into Claude Code (slm hooks remove to undo)")
|
|
1207
|
+
else:
|
|
1208
|
+
print(f" Hook install failed: {result['errors']}")
|
|
1209
|
+
|
|
1210
|
+
# Step 3: IDE connection
|
|
1211
|
+
print()
|
|
1212
|
+
print("Detecting IDEs...")
|
|
1213
|
+
try:
|
|
1214
|
+
from superlocalmemory.hooks.ide_connector import IDEConnector
|
|
1215
|
+
connector = IDEConnector()
|
|
1216
|
+
results = connector.connect_all()
|
|
1217
|
+
for ide_id, ide_status in results.items():
|
|
1218
|
+
print(f" {ide_id}: {ide_status}")
|
|
1219
|
+
except Exception as exc:
|
|
1220
|
+
print(f" IDE detection skipped: {exc}")
|
|
1221
|
+
|
|
1222
|
+
# Step 4: Warmup (embedding model)
|
|
1223
|
+
print()
|
|
1224
|
+
print("Checking embedding model...")
|
|
1225
|
+
try:
|
|
1226
|
+
from superlocalmemory.core.config import SLMConfig as _Cfg
|
|
1227
|
+
cfg = _Cfg.load()
|
|
1228
|
+
model_name = cfg.embedding.model_name
|
|
1229
|
+
print(f" Model: {model_name}")
|
|
1230
|
+
# Quick check: try creating embedding service (auto-downloads if needed)
|
|
1231
|
+
from superlocalmemory.core.embeddings import EmbeddingService
|
|
1232
|
+
svc = EmbeddingService(cfg.embedding)
|
|
1233
|
+
test_result = svc.embed_text("test")
|
|
1234
|
+
if test_result is not None and len(test_result) > 0:
|
|
1235
|
+
print(" Status: ready")
|
|
1236
|
+
else:
|
|
1237
|
+
print(" Status: model not available (run: slm warmup)")
|
|
1238
|
+
except Exception as exc:
|
|
1239
|
+
print(f" Warmup skipped: {exc}")
|
|
1240
|
+
print(" Run 'slm warmup' later to download the embedding model.")
|
|
1241
|
+
|
|
1242
|
+
# Done
|
|
1243
|
+
print()
|
|
1244
|
+
print("=" * 40)
|
|
1245
|
+
print("SLM is active. Your AI now remembers you.")
|
|
1246
|
+
print()
|
|
1247
|
+
print("What happens next:")
|
|
1248
|
+
print(" - Open Claude Code in any project")
|
|
1249
|
+
print(" - SLM auto-injects your memory context")
|
|
1250
|
+
print(" - Decisions, bugs, preferences are captured automatically")
|
|
1251
|
+
print(" - Session summaries saved when you close")
|
|
1252
|
+
print()
|
|
1253
|
+
|
|
1254
|
+
|
|
1129
1255
|
def cmd_hooks(args: Namespace) -> None:
|
|
1130
1256
|
"""Manage Claude Code hooks for invisible memory injection."""
|
|
1131
1257
|
from superlocalmemory.hooks.claude_code_hooks import (
|
|
@@ -1133,28 +1259,38 @@ def cmd_hooks(args: Namespace) -> None:
|
|
|
1133
1259
|
)
|
|
1134
1260
|
|
|
1135
1261
|
action = getattr(args, "action", "status")
|
|
1262
|
+
# Gate is OFF by default. --gate opts in (for brave users).
|
|
1263
|
+
include_gate = getattr(args, "gate", False)
|
|
1264
|
+
|
|
1136
1265
|
if action == "install":
|
|
1137
|
-
result = install_hooks()
|
|
1138
|
-
if result["
|
|
1266
|
+
result = install_hooks(include_gate=include_gate)
|
|
1267
|
+
if result["success"]:
|
|
1139
1268
|
print("SLM hooks installed in Claude Code.")
|
|
1140
|
-
print("
|
|
1269
|
+
print(f" Hook types: {', '.join(result['hooks_added'])}")
|
|
1270
|
+
if include_gate:
|
|
1271
|
+
print(" Gate: ON (enforces session_init — experimental)")
|
|
1272
|
+
print(" SLM: Hooks installed into Claude Code (slm hooks remove to undo)")
|
|
1141
1273
|
else:
|
|
1142
|
-
print(f"Installation
|
|
1274
|
+
print(f"Installation failed: {result['errors']}")
|
|
1143
1275
|
elif action == "remove":
|
|
1144
1276
|
result = remove_hooks()
|
|
1145
|
-
if result["
|
|
1277
|
+
if result["success"]:
|
|
1146
1278
|
print("SLM hooks removed from Claude Code.")
|
|
1147
1279
|
else:
|
|
1148
|
-
print(f"Removal
|
|
1280
|
+
print(f"Removal failed: {result['errors']}")
|
|
1149
1281
|
else:
|
|
1150
1282
|
result = check_status()
|
|
1151
1283
|
if result["installed"]:
|
|
1152
|
-
print("SLM hooks: INSTALLED")
|
|
1153
|
-
print(f"
|
|
1154
|
-
print("
|
|
1284
|
+
print(f"SLM hooks: INSTALLED (v{result['version']})")
|
|
1285
|
+
print(f" Hook types: {', '.join(result['hook_types'])}")
|
|
1286
|
+
print(f" Gate: {'ON' if result['gate_enabled'] else 'OFF'}")
|
|
1287
|
+
if result["needs_upgrade"]:
|
|
1288
|
+
print(f" Update available: {result['version']} -> {result['latest_version']}")
|
|
1289
|
+
print(" Run: slm hooks install")
|
|
1155
1290
|
else:
|
|
1156
1291
|
print("SLM hooks: NOT INSTALLED")
|
|
1157
1292
|
print(" Run: slm hooks install")
|
|
1293
|
+
print(" Or: slm init (full setup)")
|
|
1158
1294
|
|
|
1159
1295
|
|
|
1160
1296
|
def cmd_session_context(args: Namespace) -> None:
|
|
@@ -1435,6 +1571,7 @@ def cmd_consolidate(args: Namespace) -> None:
|
|
|
1435
1571
|
|
|
1436
1572
|
use_json = getattr(args, "json", False)
|
|
1437
1573
|
cognitive = getattr(args, "cognitive", False)
|
|
1574
|
+
dry_run = getattr(args, "dry_run", False)
|
|
1438
1575
|
profile = getattr(args, "profile", "")
|
|
1439
1576
|
|
|
1440
1577
|
if not cognitive:
|
|
@@ -1460,7 +1597,7 @@ def cmd_consolidate(args: Namespace) -> None:
|
|
|
1460
1597
|
)
|
|
1461
1598
|
|
|
1462
1599
|
consolidator = CognitiveConsolidator(db=engine._db)
|
|
1463
|
-
result = consolidator.run_pipeline(pid)
|
|
1600
|
+
result = consolidator.run_pipeline(pid, dry_run=dry_run)
|
|
1464
1601
|
except Exception as exc:
|
|
1465
1602
|
if use_json:
|
|
1466
1603
|
from superlocalmemory.cli.json_output import json_print
|
|
@@ -1473,7 +1610,7 @@ def cmd_consolidate(args: Namespace) -> None:
|
|
|
1473
1610
|
if use_json:
|
|
1474
1611
|
from superlocalmemory.cli.json_output import json_print
|
|
1475
1612
|
json_print("consolidate", data={
|
|
1476
|
-
"
|
|
1613
|
+
"clusters_processed": result.clusters_processed,
|
|
1477
1614
|
"blocks_created": result.blocks_created,
|
|
1478
1615
|
"facts_archived": result.facts_archived,
|
|
1479
1616
|
"compression_ratio": round(result.compression_ratio, 3),
|
|
@@ -1484,7 +1621,7 @@ def cmd_consolidate(args: Namespace) -> None:
|
|
|
1484
1621
|
return
|
|
1485
1622
|
|
|
1486
1623
|
print("CCQ Cognitive Consolidation")
|
|
1487
|
-
print(f" Clusters
|
|
1624
|
+
print(f" Clusters processed: {result.clusters_processed}")
|
|
1488
1625
|
print(f" Blocks created: {result.blocks_created}")
|
|
1489
1626
|
print(f" Facts archived: {result.facts_archived}")
|
|
1490
1627
|
print(f" Compression ratio: {result.compression_ratio:.3f}")
|
|
@@ -70,6 +70,12 @@ documentation:
|
|
|
70
70
|
|
|
71
71
|
def main() -> None:
|
|
72
72
|
"""Parse CLI arguments and dispatch to command handlers."""
|
|
73
|
+
# Fast path: hook invocations bypass argparse entirely (stdlib only, ~30ms)
|
|
74
|
+
if len(sys.argv) >= 3 and sys.argv[1] == "hook":
|
|
75
|
+
from superlocalmemory.hooks.hook_handlers import handle_hook
|
|
76
|
+
handle_hook(sys.argv[2])
|
|
77
|
+
return
|
|
78
|
+
|
|
73
79
|
from superlocalmemory.cli.json_output import _get_version
|
|
74
80
|
_ver = _get_version()
|
|
75
81
|
|
|
@@ -85,6 +91,15 @@ def main() -> None:
|
|
|
85
91
|
sub = parser.add_subparsers(dest="command", title="commands")
|
|
86
92
|
|
|
87
93
|
# -- Setup & Config ------------------------------------------------
|
|
94
|
+
init_p = sub.add_parser("init", help="One-command setup: mode + hooks + IDE + warmup")
|
|
95
|
+
init_p.add_argument(
|
|
96
|
+
"--force", action="store_true", help="Re-run full setup even if already configured",
|
|
97
|
+
)
|
|
98
|
+
init_p.add_argument(
|
|
99
|
+
"--gate", action="store_true",
|
|
100
|
+
help="Enable PreToolUse gate (experimental — blocks tools until session_init)",
|
|
101
|
+
)
|
|
102
|
+
|
|
88
103
|
sub.add_parser("setup", help="Interactive first-time setup wizard")
|
|
89
104
|
|
|
90
105
|
mode_p = sub.add_parser("mode", help="Get or set operating mode (a/b/c)")
|
|
@@ -123,6 +138,7 @@ def main() -> None:
|
|
|
123
138
|
|
|
124
139
|
forget_p = sub.add_parser("forget", help="Delete memories matching a query (fuzzy)")
|
|
125
140
|
forget_p.add_argument("query", help="Query to match for deletion")
|
|
141
|
+
forget_p.add_argument("--dry-run", action="store_true", default=False, help="Preview matches without deleting")
|
|
126
142
|
forget_p.add_argument("--yes", "-y", action="store_true", help="Skip confirmation prompt")
|
|
127
143
|
forget_p.add_argument("--json", action="store_true", help="Output structured JSON (agent-native)")
|
|
128
144
|
|
|
@@ -151,6 +167,7 @@ def main() -> None:
|
|
|
151
167
|
|
|
152
168
|
trace_p = sub.add_parser("trace", help="Recall with per-channel score breakdown")
|
|
153
169
|
trace_p.add_argument("query", help="Search query")
|
|
170
|
+
trace_p.add_argument("--limit", type=int, default=10, help="Max results (default 10)")
|
|
154
171
|
trace_p.add_argument("--json", action="store_true", help="Output structured JSON (agent-native)")
|
|
155
172
|
|
|
156
173
|
# -- Diagnostics (continued) ----------------------------------------
|
|
@@ -180,6 +197,10 @@ def main() -> None:
|
|
|
180
197
|
"action", nargs="?", default="status",
|
|
181
198
|
choices=["install", "remove", "status"], help="Action (default: status)",
|
|
182
199
|
)
|
|
200
|
+
hooks_p.add_argument(
|
|
201
|
+
"--gate", action="store_true",
|
|
202
|
+
help="Enable PreToolUse gate (experimental — blocks tools until session_init)",
|
|
203
|
+
)
|
|
183
204
|
|
|
184
205
|
ctx_p = sub.add_parser("session-context", help="Print session context (for hooks)")
|
|
185
206
|
ctx_p.add_argument("query", nargs="?", default="", help="Optional context query")
|
|
@@ -217,6 +238,10 @@ def main() -> None:
|
|
|
217
238
|
"--cognitive", action="store_true",
|
|
218
239
|
help="Run CCQ cognitive consolidation",
|
|
219
240
|
)
|
|
241
|
+
consolidate_p.add_argument(
|
|
242
|
+
"--dry-run", action="store_true", default=False,
|
|
243
|
+
help="Preview without applying",
|
|
244
|
+
)
|
|
220
245
|
consolidate_p.add_argument("--profile", default="", help="Target profile")
|
|
221
246
|
consolidate_p.add_argument("--json", action="store_true", help="Output structured JSON (agent-native)")
|
|
222
247
|
|
|
@@ -612,15 +612,15 @@ class SLMConfig:
|
|
|
612
612
|
|
|
613
613
|
rt = data.get("retrieval", {})
|
|
614
614
|
if rt:
|
|
615
|
-
# V3.3.2 migration:
|
|
616
|
-
# Pre-3.3.2 configs
|
|
617
|
-
#
|
|
618
|
-
#
|
|
619
|
-
# by the absence of cross_encoder_backend field.
|
|
615
|
+
# V3.3.2 migration: add ONNX cross-encoder backend field.
|
|
616
|
+
# Pre-3.3.2 configs lacked cross_encoder_backend. Add it,
|
|
617
|
+
# but NEVER override an explicit use_cross_encoder setting.
|
|
618
|
+
# The user's explicit choice always wins.
|
|
620
619
|
if "cross_encoder_backend" not in rt:
|
|
621
|
-
rt
|
|
622
|
-
rt["cross_encoder_model"] = "cross-encoder/ms-marco-MiniLM-L-6-v2"
|
|
620
|
+
rt.setdefault("cross_encoder_model", "cross-encoder/ms-marco-MiniLM-L-6-v2")
|
|
623
621
|
rt["cross_encoder_backend"] = "onnx"
|
|
622
|
+
# Only auto-enable if user didn't explicitly set the field
|
|
623
|
+
rt.setdefault("use_cross_encoder", True)
|
|
624
624
|
config.retrieval = RetrievalConfig(**{
|
|
625
625
|
k: v for k, v in rt.items()
|
|
626
626
|
if k in RetrievalConfig.__dataclass_fields__
|
|
@@ -768,6 +768,9 @@ class SLMConfig:
|
|
|
768
768
|
)
|
|
769
769
|
|
|
770
770
|
# Mode C — FULL POWER, UNRESTRICTED
|
|
771
|
+
# Don't carry over local-only providers (ollama) to cloud mode
|
|
772
|
+
c_provider = llm_provider if llm_provider not in ("ollama", "") else "openrouter"
|
|
773
|
+
c_model = llm_model if llm_provider not in ("ollama", "") else "anthropic/claude-sonnet-4"
|
|
771
774
|
return cls(
|
|
772
775
|
mode=mode,
|
|
773
776
|
base_dir=_base,
|
|
@@ -779,8 +782,8 @@ class SLMConfig:
|
|
|
779
782
|
deployment_name=embedding_deployment,
|
|
780
783
|
),
|
|
781
784
|
llm=LLMConfig(
|
|
782
|
-
provider=
|
|
783
|
-
model=
|
|
785
|
+
provider=c_provider,
|
|
786
|
+
model=c_model,
|
|
784
787
|
api_key=llm_api_key,
|
|
785
788
|
api_base=llm_api_base,
|
|
786
789
|
),
|
{superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/core/embedding_worker.py
RENAMED
|
@@ -23,9 +23,10 @@ Part of Qualixar | Author: Varun Pratap Bhardwaj
|
|
|
23
23
|
from __future__ import annotations
|
|
24
24
|
|
|
25
25
|
import json
|
|
26
|
+
import os
|
|
26
27
|
import signal
|
|
27
28
|
import sys
|
|
28
|
-
import
|
|
29
|
+
import threading
|
|
29
30
|
|
|
30
31
|
# Force CPU BEFORE any torch import
|
|
31
32
|
os.environ["CUDA_VISIBLE_DEVICES"] = ""
|
|
@@ -41,8 +42,33 @@ if sys.platform != "win32":
|
|
|
41
42
|
signal.signal(signal.SIGTERM, lambda *_: sys.exit(0))
|
|
42
43
|
|
|
43
44
|
|
|
45
|
+
def _start_parent_watchdog() -> None:
|
|
46
|
+
"""Monitor parent process — self-terminate if parent dies.
|
|
47
|
+
|
|
48
|
+
Prevents orphaned workers that consume 500-800 MB each when the parent
|
|
49
|
+
process crashes, is killed, or exits without cleanup.
|
|
50
|
+
|
|
51
|
+
V3.3.7: Added after incident where orphaned workers consumed 33 GB.
|
|
52
|
+
"""
|
|
53
|
+
parent_pid = os.getppid()
|
|
54
|
+
|
|
55
|
+
def _watch() -> None:
|
|
56
|
+
import time
|
|
57
|
+
while True:
|
|
58
|
+
time.sleep(5)
|
|
59
|
+
try:
|
|
60
|
+
os.kill(parent_pid, 0)
|
|
61
|
+
except OSError:
|
|
62
|
+
os._exit(0)
|
|
63
|
+
|
|
64
|
+
t = threading.Thread(target=_watch, daemon=True, name="parent-watchdog")
|
|
65
|
+
t.start()
|
|
66
|
+
|
|
67
|
+
|
|
44
68
|
def _worker_main() -> None:
|
|
45
69
|
"""Main loop: read JSON requests from stdin, write responses to stdout."""
|
|
70
|
+
_start_parent_watchdog() # V3.3.7: self-terminate if parent dies
|
|
71
|
+
|
|
46
72
|
import numpy as np
|
|
47
73
|
|
|
48
74
|
model = None
|
|
@@ -15,6 +15,7 @@ Part of Qualixar | Author: Varun Pratap Bhardwaj
|
|
|
15
15
|
|
|
16
16
|
from __future__ import annotations
|
|
17
17
|
|
|
18
|
+
import atexit
|
|
18
19
|
import json
|
|
19
20
|
import logging
|
|
20
21
|
import os
|
|
@@ -22,11 +23,15 @@ import subprocess
|
|
|
22
23
|
import sys
|
|
23
24
|
import threading
|
|
24
25
|
import time
|
|
26
|
+
import weakref
|
|
25
27
|
from pathlib import Path
|
|
26
28
|
from typing import TYPE_CHECKING
|
|
27
29
|
|
|
28
30
|
import numpy as np
|
|
29
31
|
|
|
32
|
+
# Track all live embedding services for atexit cleanup
|
|
33
|
+
_live_embedding_services: set[weakref.ref] = set()
|
|
34
|
+
|
|
30
35
|
if TYPE_CHECKING:
|
|
31
36
|
from numpy.typing import NDArray
|
|
32
37
|
|
|
@@ -69,6 +74,17 @@ class EmbeddingService:
|
|
|
69
74
|
self._worker_ready = False
|
|
70
75
|
self._request_count: int = 0
|
|
71
76
|
|
|
77
|
+
# Register for atexit cleanup (prevent orphaned workers)
|
|
78
|
+
ref = weakref.ref(self, _live_embedding_services.discard)
|
|
79
|
+
_live_embedding_services.add(ref)
|
|
80
|
+
|
|
81
|
+
def __del__(self) -> None:
|
|
82
|
+
"""Kill worker subprocess when service is garbage-collected."""
|
|
83
|
+
try:
|
|
84
|
+
self._kill_worker()
|
|
85
|
+
except Exception:
|
|
86
|
+
pass
|
|
87
|
+
|
|
72
88
|
@property
|
|
73
89
|
def is_available(self) -> bool:
|
|
74
90
|
"""Check if embedding service can produce embeddings."""
|
|
@@ -338,3 +354,26 @@ class EmbeddingService:
|
|
|
338
354
|
raise DimensionMismatchError(
|
|
339
355
|
f"Embedding dimension {actual} != expected {self._config.dimension}"
|
|
340
356
|
)
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
# ---------------------------------------------------------------------------
|
|
360
|
+
# Module-level atexit: kill ALL embedding workers on process exit
|
|
361
|
+
# ---------------------------------------------------------------------------
|
|
362
|
+
|
|
363
|
+
def _cleanup_all_embedding_services() -> None:
|
|
364
|
+
"""Kill all embedding worker subprocesses on interpreter exit.
|
|
365
|
+
|
|
366
|
+
Prevents orphaned 500-800 MB sentence-transformer workers surviving
|
|
367
|
+
after parent exits (especially during test runs with parallel agents).
|
|
368
|
+
"""
|
|
369
|
+
for ref in list(_live_embedding_services):
|
|
370
|
+
svc = ref()
|
|
371
|
+
if svc is not None:
|
|
372
|
+
try:
|
|
373
|
+
svc._kill_worker()
|
|
374
|
+
except Exception:
|
|
375
|
+
pass
|
|
376
|
+
_live_embedding_services.clear()
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
atexit.register(_cleanup_all_embedding_services)
|
{superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/core/recall_worker.py
RENAMED
|
@@ -20,6 +20,7 @@ import json
|
|
|
20
20
|
import os
|
|
21
21
|
import signal
|
|
22
22
|
import sys
|
|
23
|
+
import threading
|
|
23
24
|
|
|
24
25
|
# Force CPU BEFORE any torch import
|
|
25
26
|
os.environ["CUDA_VISIBLE_DEVICES"] = ""
|
|
@@ -34,6 +35,29 @@ os.environ["TORCH_DEVICE"] = "cpu"
|
|
|
34
35
|
if sys.platform != "win32":
|
|
35
36
|
signal.signal(signal.SIGTERM, lambda *_: sys.exit(0))
|
|
36
37
|
|
|
38
|
+
|
|
39
|
+
def _start_parent_watchdog() -> None:
|
|
40
|
+
"""Monitor parent process — self-terminate if parent dies.
|
|
41
|
+
|
|
42
|
+
Prevents orphaned workers that consume 500+ MB each when the parent
|
|
43
|
+
process crashes, is killed, or exits without cleanup.
|
|
44
|
+
|
|
45
|
+
V3.3.7: Added after incident where orphaned workers consumed 33 GB.
|
|
46
|
+
"""
|
|
47
|
+
parent_pid = os.getppid()
|
|
48
|
+
|
|
49
|
+
def _watch() -> None:
|
|
50
|
+
import time
|
|
51
|
+
while True:
|
|
52
|
+
time.sleep(5)
|
|
53
|
+
try:
|
|
54
|
+
os.kill(parent_pid, 0)
|
|
55
|
+
except OSError:
|
|
56
|
+
os._exit(0)
|
|
57
|
+
|
|
58
|
+
t = threading.Thread(target=_watch, daemon=True, name="parent-watchdog")
|
|
59
|
+
t.start()
|
|
60
|
+
|
|
37
61
|
_engine = None
|
|
38
62
|
|
|
39
63
|
|
|
@@ -209,6 +233,8 @@ def _handle_status() -> dict:
|
|
|
209
233
|
|
|
210
234
|
def _worker_main() -> None:
|
|
211
235
|
"""Main loop: read JSON requests from stdin, write responses to stdout."""
|
|
236
|
+
_start_parent_watchdog() # V3.3.7: self-terminate if parent dies
|
|
237
|
+
|
|
212
238
|
for line in sys.stdin:
|
|
213
239
|
line = line.strip()
|
|
214
240
|
if not line:
|
|
@@ -142,8 +142,15 @@ class WorkerPool:
|
|
|
142
142
|
# ------------------------------------------------------------------
|
|
143
143
|
|
|
144
144
|
def _send(self, request: dict) -> dict:
|
|
145
|
-
"""Send request to worker and get response. Thread-safe.
|
|
146
|
-
|
|
145
|
+
"""Send request to worker and get response. Thread-safe.
|
|
146
|
+
|
|
147
|
+
Auto-retries once on worker death (idle timeout, crash).
|
|
148
|
+
"""
|
|
149
|
+
resp = self._send_with_timeout(request, timeout=_REQUEST_TIMEOUT)
|
|
150
|
+
if not resp.get("ok") and "Worker" in resp.get("error", ""):
|
|
151
|
+
logger.info("Auto-restarting worker after failure, retrying request")
|
|
152
|
+
resp = self._send_with_timeout(request, timeout=_REQUEST_TIMEOUT)
|
|
153
|
+
return resp
|
|
147
154
|
|
|
148
155
|
def _send_with_timeout(self, request: dict, timeout: float) -> dict:
|
|
149
156
|
"""Send request with configurable timeout. Thread-safe."""
|
|
@@ -214,11 +214,17 @@ class CognitiveConsolidator:
|
|
|
214
214
|
# Public API
|
|
215
215
|
# ------------------------------------------------------------------
|
|
216
216
|
|
|
217
|
-
def run_pipeline(
|
|
217
|
+
def run_pipeline(
|
|
218
|
+
self, profile_id: str, dry_run: bool = False,
|
|
219
|
+
) -> CCQPipelineResult:
|
|
218
220
|
"""Execute the full 6-step CCQ pipeline.
|
|
219
221
|
|
|
220
222
|
Per-cluster error isolation: one cluster failure does NOT
|
|
221
223
|
abort the pipeline (HR-07).
|
|
224
|
+
|
|
225
|
+
Args:
|
|
226
|
+
profile_id: Target profile.
|
|
227
|
+
dry_run: If True, identify clusters but don't apply changes.
|
|
222
228
|
"""
|
|
223
229
|
# Step 1: Identify candidates
|
|
224
230
|
candidates = self._step1_identify(profile_id)
|
|
@@ -230,6 +236,18 @@ class CognitiveConsolidator:
|
|
|
230
236
|
if not clusters:
|
|
231
237
|
return self._empty_result()
|
|
232
238
|
|
|
239
|
+
if dry_run:
|
|
240
|
+
return CCQPipelineResult(
|
|
241
|
+
clusters_processed=len(clusters),
|
|
242
|
+
blocks_created=0,
|
|
243
|
+
facts_archived=len(candidates),
|
|
244
|
+
total_bytes_before=0,
|
|
245
|
+
total_bytes_after=0,
|
|
246
|
+
compression_ratio=0.0,
|
|
247
|
+
audit_entries=(),
|
|
248
|
+
errors=(),
|
|
249
|
+
)
|
|
250
|
+
|
|
233
251
|
# Process each cluster
|
|
234
252
|
blocks_created = 0
|
|
235
253
|
facts_archived = 0
|
{superlocalmemory-3.3.3 → superlocalmemory-3.3.7}/src/superlocalmemory/encoding/emotional.py
RENAMED
|
@@ -30,8 +30,11 @@ def _get_vader():
|
|
|
30
30
|
if _vader_analyzer is not None:
|
|
31
31
|
return _vader_analyzer
|
|
32
32
|
try:
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
import warnings
|
|
34
|
+
with warnings.catch_warnings():
|
|
35
|
+
warnings.filterwarnings("ignore", category=DeprecationWarning, module="vaderSentiment")
|
|
36
|
+
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
|
|
37
|
+
_vader_analyzer = SentimentIntensityAnalyzer()
|
|
35
38
|
except ImportError:
|
|
36
39
|
logger.warning("vaderSentiment not installed — emotional tagging disabled")
|
|
37
40
|
_vader_analyzer = None
|