levh 2.26.8__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.
Files changed (235) hide show
  1. levh-2.26.8/.env.example +91 -0
  2. levh-2.26.8/CHANGELOG.md +831 -0
  3. levh-2.26.8/CONTRIBUTING.md +31 -0
  4. levh-2.26.8/LICENSE +21 -0
  5. levh-2.26.8/MANIFEST.in +7 -0
  6. levh-2.26.8/PKG-INFO +677 -0
  7. levh-2.26.8/README.md +636 -0
  8. levh-2.26.8/SECURITY.md +19 -0
  9. levh-2.26.8/levh.egg-info/PKG-INFO +677 -0
  10. levh-2.26.8/levh.egg-info/SOURCES.txt +233 -0
  11. levh-2.26.8/levh.egg-info/dependency_links.txt +1 -0
  12. levh-2.26.8/levh.egg-info/entry_points.txt +2 -0
  13. levh-2.26.8/levh.egg-info/requires.txt +25 -0
  14. levh-2.26.8/levh.egg-info/top_level.txt +1 -0
  15. levh-2.26.8/pyproject.toml +54 -0
  16. levh-2.26.8/server/__init__.py +1 -0
  17. levh-2.26.8/server/api.py +1475 -0
  18. levh-2.26.8/server/cli.py +1666 -0
  19. levh-2.26.8/server/configs.py +210 -0
  20. levh-2.26.8/server/connectors/__init__.py +82 -0
  21. levh-2.26.8/server/connectors/base.py +58 -0
  22. levh-2.26.8/server/connectors/calendar.py +269 -0
  23. levh-2.26.8/server/connectors/email_connector.py +274 -0
  24. levh-2.26.8/server/connectors/github.py +307 -0
  25. levh-2.26.8/server/connectors/local_files.py +275 -0
  26. levh-2.26.8/server/connectors/notion.py +343 -0
  27. levh-2.26.8/server/connectors/obsidian.py +194 -0
  28. levh-2.26.8/server/connectors/transcript.py +204 -0
  29. levh-2.26.8/server/core/__init__.py +1 -0
  30. levh-2.26.8/server/core/admission.py +142 -0
  31. levh-2.26.8/server/core/answerer.py +111 -0
  32. levh-2.26.8/server/core/backup.py +76 -0
  33. levh-2.26.8/server/core/benchmark.py +113 -0
  34. levh-2.26.8/server/core/conflict.py +137 -0
  35. levh-2.26.8/server/core/conflict_service.py +203 -0
  36. levh-2.26.8/server/core/crypto.py +104 -0
  37. levh-2.26.8/server/core/database.py +1145 -0
  38. levh-2.26.8/server/core/demo_data.py +287 -0
  39. levh-2.26.8/server/core/dogfood.py +287 -0
  40. levh-2.26.8/server/core/embedder.py +209 -0
  41. levh-2.26.8/server/core/engine_provider.py +41 -0
  42. levh-2.26.8/server/core/entities.py +123 -0
  43. levh-2.26.8/server/core/entity_index_service.py +112 -0
  44. levh-2.26.8/server/core/episodic.py +65 -0
  45. levh-2.26.8/server/core/evaluation.py +374 -0
  46. levh-2.26.8/server/core/hscore.py +227 -0
  47. levh-2.26.8/server/core/memory_engine.py +2542 -0
  48. levh-2.26.8/server/core/onboarding.py +222 -0
  49. levh-2.26.8/server/core/organizations.py +180 -0
  50. levh-2.26.8/server/core/people.py +145 -0
  51. levh-2.26.8/server/core/rate_limit.py +41 -0
  52. levh-2.26.8/server/core/runtime_config.py +179 -0
  53. levh-2.26.8/server/core/short_term.py +51 -0
  54. levh-2.26.8/server/core/summarizer.py +98 -0
  55. levh-2.26.8/server/core/trust.py +245 -0
  56. levh-2.26.8/server/core/trust_service.py +202 -0
  57. levh-2.26.8/server/core/types.py +126 -0
  58. levh-2.26.8/server/core/vector_store.py +99 -0
  59. levh-2.26.8/server/dashboard/.gitkeep +0 -0
  60. levh-2.26.8/server/dashboard/404/index.html +1 -0
  61. levh-2.26.8/server/dashboard/404.html +1 -0
  62. levh-2.26.8/server/dashboard/_next/static/EZcdmRBfcJ0DYaaVxZUoA/_buildManifest.js +1 -0
  63. levh-2.26.8/server/dashboard/_next/static/EZcdmRBfcJ0DYaaVxZUoA/_ssgManifest.js +1 -0
  64. levh-2.26.8/server/dashboard/_next/static/chunks/172-374e517eabaafcd5.js +1 -0
  65. levh-2.26.8/server/dashboard/_next/static/chunks/248-0c9b0a583e391364.js +1 -0
  66. levh-2.26.8/server/dashboard/_next/static/chunks/255-d19a68d5cdf61c74.js +1 -0
  67. levh-2.26.8/server/dashboard/_next/static/chunks/344-3be46b3334d4bc18.js +1 -0
  68. levh-2.26.8/server/dashboard/_next/static/chunks/354-9411c560837c5643.js +1 -0
  69. levh-2.26.8/server/dashboard/_next/static/chunks/356-5550b6a9746410aa.js +1 -0
  70. levh-2.26.8/server/dashboard/_next/static/chunks/4bd1b696-409494caf8c83275.js +1 -0
  71. levh-2.26.8/server/dashboard/_next/static/chunks/546-53d4e5ffa0741b01.js +1 -0
  72. levh-2.26.8/server/dashboard/_next/static/chunks/558-9f3c6f8ed16a6154.js +1 -0
  73. levh-2.26.8/server/dashboard/_next/static/chunks/619-f072ac750404f9da.js +1 -0
  74. levh-2.26.8/server/dashboard/_next/static/chunks/710-d525d6a7457e5361.js +1 -0
  75. levh-2.26.8/server/dashboard/_next/static/chunks/850-f246cebe0acecdde.js +1 -0
  76. levh-2.26.8/server/dashboard/_next/static/chunks/993-0d39fec9aa3922aa.js +1 -0
  77. levh-2.26.8/server/dashboard/_next/static/chunks/app/_not-found/page-bb8623766fc272ad.js +1 -0
  78. levh-2.26.8/server/dashboard/_next/static/chunks/app/briefing/page-431da3d802906b86.js +1 -0
  79. levh-2.26.8/server/dashboard/_next/static/chunks/app/conflicts/page-f310caecd3370eab.js +1 -0
  80. levh-2.26.8/server/dashboard/_next/static/chunks/app/decisions/page-506a20f430b2d7e1.js +1 -0
  81. levh-2.26.8/server/dashboard/_next/static/chunks/app/graph/page-9342ca8482acab35.js +1 -0
  82. levh-2.26.8/server/dashboard/_next/static/chunks/app/layout-0887bec82bd4e181.js +1 -0
  83. levh-2.26.8/server/dashboard/_next/static/chunks/app/meeting-prep/page-960d2dddc5228bdf.js +1 -0
  84. levh-2.26.8/server/dashboard/_next/static/chunks/app/memories/page-14785c77921a05f7.js +1 -0
  85. levh-2.26.8/server/dashboard/_next/static/chunks/app/organizations/page-530f19e026dfd476.js +1 -0
  86. levh-2.26.8/server/dashboard/_next/static/chunks/app/page-9070d4eaaebc7f50.js +1 -0
  87. levh-2.26.8/server/dashboard/_next/static/chunks/app/people/page-35fc9df360827250.js +1 -0
  88. levh-2.26.8/server/dashboard/_next/static/chunks/app/projects/page-c084863047d2a1a6.js +1 -0
  89. levh-2.26.8/server/dashboard/_next/static/chunks/app/review/page-2f2ac3f22a8e3698.js +1 -0
  90. levh-2.26.8/server/dashboard/_next/static/chunks/app/sessions/page-efdac681166a9439.js +1 -0
  91. levh-2.26.8/server/dashboard/_next/static/chunks/app/settings/page-8c0c28a283f49875.js +1 -0
  92. levh-2.26.8/server/dashboard/_next/static/chunks/app/timeline/page-9436e6fa22ee3645.js +1 -0
  93. levh-2.26.8/server/dashboard/_next/static/chunks/app/visualize/page-0d25c2374a0b6fce.js +1 -0
  94. levh-2.26.8/server/dashboard/_next/static/chunks/framework-f52ebcb9f26a1e11.js +1 -0
  95. levh-2.26.8/server/dashboard/_next/static/chunks/main-875cb23dc0a1f18e.js +1 -0
  96. levh-2.26.8/server/dashboard/_next/static/chunks/main-app-181ccbd6eeeceb1e.js +1 -0
  97. levh-2.26.8/server/dashboard/_next/static/chunks/pages/_app-5addca2b3b969fde.js +1 -0
  98. levh-2.26.8/server/dashboard/_next/static/chunks/pages/_error-022e4ac7bbb9914f.js +1 -0
  99. levh-2.26.8/server/dashboard/_next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
  100. levh-2.26.8/server/dashboard/_next/static/chunks/webpack-681601bcc1224fcd.js +1 -0
  101. levh-2.26.8/server/dashboard/_next/static/css/809d4951adcd5b63.css +3 -0
  102. levh-2.26.8/server/dashboard/brand/levh-mark.png +0 -0
  103. levh-2.26.8/server/dashboard/briefing/index.html +1 -0
  104. levh-2.26.8/server/dashboard/briefing/index.txt +24 -0
  105. levh-2.26.8/server/dashboard/conflicts/index.html +1 -0
  106. levh-2.26.8/server/dashboard/conflicts/index.txt +24 -0
  107. levh-2.26.8/server/dashboard/decisions/index.html +1 -0
  108. levh-2.26.8/server/dashboard/decisions/index.txt +24 -0
  109. levh-2.26.8/server/dashboard/graph/index.html +1 -0
  110. levh-2.26.8/server/dashboard/graph/index.txt +24 -0
  111. levh-2.26.8/server/dashboard/icon.svg +9 -0
  112. levh-2.26.8/server/dashboard/index.html +1 -0
  113. levh-2.26.8/server/dashboard/index.txt +24 -0
  114. levh-2.26.8/server/dashboard/meeting-prep/index.html +1 -0
  115. levh-2.26.8/server/dashboard/meeting-prep/index.txt +24 -0
  116. levh-2.26.8/server/dashboard/memories/index.html +1 -0
  117. levh-2.26.8/server/dashboard/memories/index.txt +24 -0
  118. levh-2.26.8/server/dashboard/organizations/index.html +1 -0
  119. levh-2.26.8/server/dashboard/organizations/index.txt +24 -0
  120. levh-2.26.8/server/dashboard/people/index.html +1 -0
  121. levh-2.26.8/server/dashboard/people/index.txt +24 -0
  122. levh-2.26.8/server/dashboard/projects/index.html +1 -0
  123. levh-2.26.8/server/dashboard/projects/index.txt +24 -0
  124. levh-2.26.8/server/dashboard/review/index.html +1 -0
  125. levh-2.26.8/server/dashboard/review/index.txt +24 -0
  126. levh-2.26.8/server/dashboard/sessions/index.html +1 -0
  127. levh-2.26.8/server/dashboard/sessions/index.txt +24 -0
  128. levh-2.26.8/server/dashboard/settings/index.html +1 -0
  129. levh-2.26.8/server/dashboard/settings/index.txt +24 -0
  130. levh-2.26.8/server/dashboard/timeline/index.html +1 -0
  131. levh-2.26.8/server/dashboard/timeline/index.txt +24 -0
  132. levh-2.26.8/server/dashboard/visualize/index.html +1 -0
  133. levh-2.26.8/server/dashboard/visualize/index.txt +24 -0
  134. levh-2.26.8/server/fixtures/__init__.py +0 -0
  135. levh-2.26.8/server/fixtures/evaluation/01_project_decision_superseded.json +30 -0
  136. levh-2.26.8/server/fixtures/evaluation/02_meeting_deadline_changed.json +31 -0
  137. levh-2.26.8/server/fixtures/evaluation/03_same_fact_independent_sources.json +41 -0
  138. levh-2.26.8/server/fixtures/evaluation/04_same_source_duplicate.json +24 -0
  139. levh-2.26.8/server/fixtures/evaluation/05_low_trust_imported_text.json +19 -0
  140. levh-2.26.8/server/fixtures/evaluation/06_confirmed_human_memory.json +31 -0
  141. levh-2.26.8/server/fixtures/evaluation/07_fading_important_memory.json +35 -0
  142. levh-2.26.8/server/fixtures/evaluation/08_redacted_secret.json +18 -0
  143. levh-2.26.8/server/fixtures/evaluation/09_conflict_false_positive_guard.json +28 -0
  144. levh-2.26.8/server/mcp_sse.py +55 -0
  145. levh-2.26.8/server/mcp_stdio.py +71 -0
  146. levh-2.26.8/server/routes/__init__.py +1 -0
  147. levh-2.26.8/server/tools/__init__.py +1 -0
  148. levh-2.26.8/server/tools/admission.py +74 -0
  149. levh-2.26.8/server/tools/ask.py +52 -0
  150. levh-2.26.8/server/tools/backup.py +87 -0
  151. levh-2.26.8/server/tools/briefing.py +57 -0
  152. levh-2.26.8/server/tools/clear_short_term.py +19 -0
  153. levh-2.26.8/server/tools/conflicts.py +90 -0
  154. levh-2.26.8/server/tools/connector_sync.py +86 -0
  155. levh-2.26.8/server/tools/connectors.py +126 -0
  156. levh-2.26.8/server/tools/consolidate.py +25 -0
  157. levh-2.26.8/server/tools/consolidate_memories.py +56 -0
  158. levh-2.26.8/server/tools/context_file.py +31 -0
  159. levh-2.26.8/server/tools/decisions.py +37 -0
  160. levh-2.26.8/server/tools/dedupe.py +50 -0
  161. levh-2.26.8/server/tools/entities.py +80 -0
  162. levh-2.26.8/server/tools/export_import.py +43 -0
  163. levh-2.26.8/server/tools/feedback.py +74 -0
  164. levh-2.26.8/server/tools/forget.py +30 -0
  165. levh-2.26.8/server/tools/get_context.py +35 -0
  166. levh-2.26.8/server/tools/list_memories.py +55 -0
  167. levh-2.26.8/server/tools/meeting_prep.py +61 -0
  168. levh-2.26.8/server/tools/organizations.py +78 -0
  169. levh-2.26.8/server/tools/people.py +69 -0
  170. levh-2.26.8/server/tools/pin.py +42 -0
  171. levh-2.26.8/server/tools/privacy.py +72 -0
  172. levh-2.26.8/server/tools/profiles.py +137 -0
  173. levh-2.26.8/server/tools/projects.py +42 -0
  174. levh-2.26.8/server/tools/recall.py +49 -0
  175. levh-2.26.8/server/tools/register.py +143 -0
  176. levh-2.26.8/server/tools/reinforce.py +35 -0
  177. levh-2.26.8/server/tools/related.py +28 -0
  178. levh-2.26.8/server/tools/review.py +80 -0
  179. levh-2.26.8/server/tools/search.py +41 -0
  180. levh-2.26.8/server/tools/session.py +48 -0
  181. levh-2.26.8/server/tools/set_importance.py +23 -0
  182. levh-2.26.8/server/tools/stats.py +26 -0
  183. levh-2.26.8/server/tools/store.py +65 -0
  184. levh-2.26.8/server/tools/summarize.py +27 -0
  185. levh-2.26.8/server/tools/timeline.py +34 -0
  186. levh-2.26.8/server/tools/trust.py +72 -0
  187. levh-2.26.8/server/tools/update.py +48 -0
  188. levh-2.26.8/setup.cfg +4 -0
  189. levh-2.26.8/tests/test_admission.py +252 -0
  190. levh-2.26.8/tests/test_admission_ingress.py +250 -0
  191. levh-2.26.8/tests/test_api_smoke.py +139 -0
  192. levh-2.26.8/tests/test_ask.py +156 -0
  193. levh-2.26.8/tests/test_backup.py +348 -0
  194. levh-2.26.8/tests/test_briefing.py +384 -0
  195. levh-2.26.8/tests/test_calendar_connector.py +225 -0
  196. levh-2.26.8/tests/test_cli.py +221 -0
  197. levh-2.26.8/tests/test_conflict_candidates.py +409 -0
  198. levh-2.26.8/tests/test_connector_sync.py +245 -0
  199. levh-2.26.8/tests/test_consolidation.py +233 -0
  200. levh-2.26.8/tests/test_decisions.py +228 -0
  201. levh-2.26.8/tests/test_demo_conflict_eval.py +88 -0
  202. levh-2.26.8/tests/test_demo_data_cleanup.py +47 -0
  203. levh-2.26.8/tests/test_dogfood_metrics.py +146 -0
  204. levh-2.26.8/tests/test_dogfood_wiring.py +181 -0
  205. levh-2.26.8/tests/test_email_connector.py +260 -0
  206. levh-2.26.8/tests/test_embedder_modes.py +20 -0
  207. levh-2.26.8/tests/test_entity_graph.py +293 -0
  208. levh-2.26.8/tests/test_integration.py +774 -0
  209. levh-2.26.8/tests/test_integrity_hardening.py +140 -0
  210. levh-2.26.8/tests/test_mcp_blackbox.py +126 -0
  211. levh-2.26.8/tests/test_mcp_profile_boundaries.py +75 -0
  212. levh-2.26.8/tests/test_mcp_profiles.py +137 -0
  213. levh-2.26.8/tests/test_meeting_prep.py +256 -0
  214. levh-2.26.8/tests/test_memory_evaluation.py +167 -0
  215. levh-2.26.8/tests/test_onboarding_api.py +61 -0
  216. levh-2.26.8/tests/test_onboarding_privacy.py +52 -0
  217. levh-2.26.8/tests/test_onboarding_status.py +65 -0
  218. levh-2.26.8/tests/test_operational_hardening.py +282 -0
  219. levh-2.26.8/tests/test_organizations.py +286 -0
  220. levh-2.26.8/tests/test_packaging.py +104 -0
  221. levh-2.26.8/tests/test_people.py +184 -0
  222. levh-2.26.8/tests/test_provenance_trust.py +413 -0
  223. levh-2.26.8/tests/test_redaction_audit.py +309 -0
  224. levh-2.26.8/tests/test_release_pipeline.py +159 -0
  225. levh-2.26.8/tests/test_review_fixes.py +161 -0
  226. levh-2.26.8/tests/test_robustness_hardening.py +105 -0
  227. levh-2.26.8/tests/test_runtime_config.py +92 -0
  228. levh-2.26.8/tests/test_runtime_config_integration.py +79 -0
  229. levh-2.26.8/tests/test_score_breakdown_api.py +226 -0
  230. levh-2.26.8/tests/test_seed_demo.py +145 -0
  231. levh-2.26.8/tests/test_setup_cli.py +72 -0
  232. levh-2.26.8/tests/test_spaced_repetition.py +263 -0
  233. levh-2.26.8/tests/test_timeline.py +169 -0
  234. levh-2.26.8/tests/test_transcript_connector.py +210 -0
  235. levh-2.26.8/tests/test_v2_features.py +707 -0
@@ -0,0 +1,91 @@
1
+ # ── StackMemory Environment Variables ──
2
+ # Environment values override .stackmemory/config.json. This file is a
3
+ # template only; StackMemory does not load .env automatically. Export the
4
+ # variables in the process that starts the CLI/API/MCP server.
5
+
6
+
7
+ # SQLite
8
+ SQLITE_DB_PATH=./stackmemory.db
9
+ # File databases use WAL and a lock wait; tune only for unusual deployments.
10
+ # STACKMEMORY_SQLITE_BUSY_TIMEOUT_MS=5000
11
+ # Replace-mode restore writes an online SQLite safety copy here. Default:
12
+ # a safety-backups/ directory beside SQLITE_DB_PATH.
13
+ # STACKMEMORY_SAFETY_BACKUP_DIR=./safety-backups
14
+
15
+ # Embedding mode: "auto" (local-first; never selects OpenAI from an ambient
16
+ # key), "local", "openai", "ollama" (fully local via an Ollama server), or
17
+ # "hash" (offline fallback). Use openai explicitly for remote embeddings.
18
+ EMBEDDER_MODE=local
19
+ # OPENAI_API_KEY=sk-...
20
+
21
+ # Local model name (for sentence-transformers)
22
+ LOCAL_MODEL=all-MiniLM-L6-v2
23
+
24
+ # Ollama (EMBEDDER_MODE=ollama)
25
+ OLLAMA_URL=http://localhost:11434
26
+ OLLAMA_MODEL=nomic-embed-text
27
+
28
+ # Short-term memory max entries
29
+ SHORT_TERM_MAX=50
30
+
31
+ # Default decay half-life in hours (each memory starts here, then grows
32
+ # its OWN half-life every time it's recalled or reinforced)
33
+ DECAY_HALF_LIFE_HOURS=168
34
+
35
+ # H(x,ψ) Weights
36
+ HSCORE_ALPHA=0.4
37
+ HSCORE_BETA=0.2
38
+ HSCORE_GAMMA=0.3
39
+ HSCORE_DELTA=0.1
40
+
41
+ # Reinforcement (spaced-repetition style memory strengthening)
42
+ # Each recall multiplies a memory's stability by (1 + gain*(0.5+importance)).
43
+ REINFORCEMENT_GAIN=0.5
44
+ # Cap on how durable a memory can become (hours). Default: 1 year.
45
+ MAX_STABILITY_HOURS=8760
46
+ # Negative feedback (memory_feedback helpful=false) multiplies stability by this.
47
+ FEEDBACK_WEAKEN_FACTOR=0.5
48
+
49
+ # Auto-capture: summarize a session's memories into one durable memory when the
50
+ # session ends. Uses an LLM if OPENAI_API_KEY is set, else a deterministic
51
+ # offline (extractive) summary. Off by default.
52
+ # AUTO_SUMMARIZE_SESSIONS=false
53
+ # SUMMARY_MODEL=gpt-4o-mini
54
+
55
+ # Retroactive interference: a new memory this similar to an older one weakens it.
56
+ # 0.97 is safe in every embedder mode (fires only on near-duplicates);
57
+ # with a semantic embedder (local/openai/ollama), 0.88-0.92 also catches
58
+ # contradictions ("deploy branch is main" vs "deploy branch is prod").
59
+ # Set to 1.0 to disable.
60
+ INTERFERENCE_THRESHOLD=0.97
61
+ INTERFERENCE_FACTOR=0.6
62
+
63
+ # API
64
+ API_HOST=127.0.0.1
65
+ API_PORT=8000
66
+
67
+ # Optional shared-secret gate. When set, every /api/* request (except
68
+ # /api/health) and the WebSocket must present it via the X-StackMemory-Token
69
+ # header (or ?token= for the socket). Unset = zero-config, local use only.
70
+ # STACKMEMORY_TOKEN=change-me
71
+ # In-process limits apply only when STACKMEMORY_TOKEN is enabled. They slow
72
+ # brute-force attempts on one process; use a reverse proxy for distributed
73
+ # deployments.
74
+ # STACKMEMORY_AUTH_RATE_LIMIT=10
75
+ # STACKMEMORY_API_RATE_LIMIT=120
76
+ # STACKMEMORY_RATE_LIMIT_WINDOW_SECONDS=60
77
+
78
+ # Allowed CORS origins (comma-separated). Defaults to localhost only so a
79
+ # random website can't read your local memory store from the browser.
80
+ # Set to "*" to allow any origin (not recommended for a local tool).
81
+ # STACKMEMORY_CORS_ORIGINS=http://localhost:3000,http://127.0.0.1:3000,http://localhost:8000,http://127.0.0.1:8000
82
+
83
+ # Optional local dogfood metrics. Disabled by default. When enabled, only
84
+ # whitelisted aggregate events are appended locally; raw memory/query content
85
+ # is rejected and nothing is sent over the network. Processes must be restarted
86
+ # after changing the flag.
87
+ # STACKMEMORY_DOGFOOD_ENABLED=false
88
+ # DOGFOOD_JOURNAL_PATH=./dogfood_events.jsonl
89
+
90
+ # Optional privacy-safe local onboarding receipt path.
91
+ # STACKMEMORY_ONBOARDING_RECEIPT_PATH=.stackmemory/onboarding-receipt.json