ltcai 5.1.0 → 5.3.0

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 (41) hide show
  1. package/README.md +143 -159
  2. package/docs/CHANGELOG.md +72 -2355
  3. package/docs/DEVELOPMENT.md +99 -0
  4. package/docs/LEGACY_COMPATIBILITY.md +55 -0
  5. package/docs/V4_1_VALIDATION_REPORT.md +1 -1
  6. package/docs/V4_3_PRODUCT_HARDENING_REPORT.md +2 -2
  7. package/docs/V4_5_1_VALIDATION_REPORT.md +2 -1
  8. package/docs/WHY_LATTICE.md +4 -3
  9. package/frontend/src/components/FirstRunGuide.tsx +5 -5
  10. package/frontend/src/components/ProductFlow.tsx +1 -1
  11. package/frontend/src/i18n.ts +40 -40
  12. package/frontend/src/pages/Library.tsx +46 -9
  13. package/lattice_brain/__init__.py +1 -1
  14. package/lattice_brain/archive.py +12 -0
  15. package/lattice_brain/portability.py +14 -0
  16. package/lattice_brain/runtime/multi_agent.py +1 -1
  17. package/latticeai/__init__.py +1 -1
  18. package/latticeai/api/marketplace.py +2 -2
  19. package/latticeai/api/models.py +20 -4
  20. package/latticeai/app_factory.py +4 -78
  21. package/latticeai/core/marketplace.py +1 -1
  22. package/latticeai/core/workspace_os.py +18 -4
  23. package/latticeai/runtime/__init__.py +2 -0
  24. package/latticeai/runtime/brain_runtime.py +41 -0
  25. package/latticeai/runtime/config_runtime.py +36 -0
  26. package/latticeai/runtime/security_runtime.py +27 -0
  27. package/latticeai/services/model_capability_registry.py +482 -0
  28. package/latticeai/services/model_catalog.py +99 -96
  29. package/latticeai/services/model_recommendation.py +12 -1
  30. package/package.json +2 -2
  31. package/scripts/verify_hf_model_registry.py +306 -0
  32. package/src-tauri/Cargo.lock +1 -1
  33. package/src-tauri/Cargo.toml +1 -1
  34. package/src-tauri/tauri.conf.json +1 -1
  35. package/static/app/asset-manifest.json +5 -5
  36. package/static/app/assets/index-CQmHhk8Q.css +2 -0
  37. package/static/app/assets/{index-DONOJfMn.js → index-sOXTFUQc.js} +2 -2
  38. package/static/app/assets/index-sOXTFUQc.js.map +1 -0
  39. package/static/app/index.html +2 -2
  40. package/static/app/assets/index-DONOJfMn.js.map +0 -1
  41. package/static/app/assets/index-DuYYT2oh.css +0 -2
@@ -0,0 +1,99 @@
1
+ # Lattice AI Development
2
+
3
+ This document is for contributors working on the local-first Digital Brain
4
+ codebase. Product positioning and quick start stay in `README.md`; release
5
+ history stays in `docs/CHANGELOG.md` and `RELEASE.md`.
6
+
7
+ ## Product Contract
8
+
9
+ Lattice AI is a local-first Digital Brain that keeps your knowledge durable
10
+ across any AI model.
11
+
12
+ Engineering work should preserve these boundaries:
13
+
14
+ - the Brain is the durable asset;
15
+ - models are replaceable voices;
16
+ - SQLite is the default local store;
17
+ - PostgreSQL, Docker, cloud models, downloads, update checks, Telegram, and
18
+ Brain Network are opt-in;
19
+ - import-only paths must not initialize MLX/GPU, write files, or make network
20
+ calls;
21
+ - normal Brain use must stay separate from Admin/operator controls.
22
+
23
+ ## Local Setup
24
+
25
+ ```bash
26
+ npm install
27
+ npm run dev
28
+ ```
29
+
30
+ The local app is served through the FastAPI sidecar at:
31
+
32
+ ```text
33
+ http://127.0.0.1:4825/app
34
+ ```
35
+
36
+ Apple Silicon local model extras:
37
+
38
+ ```bash
39
+ pip install "ltcai[local]"
40
+ ```
41
+
42
+ ## Validation
43
+
44
+ Run the smallest affected gate while iterating. Before committing broad runtime,
45
+ API, UI, or release work, run:
46
+
47
+ ```bash
48
+ npm run check:python
49
+ node scripts/run_python.mjs -m ruff check .
50
+ npm run lint
51
+ npm run typecheck
52
+ npm run test:unit
53
+ npm run docs:check-links
54
+ ```
55
+
56
+ Use these when the change touches the relevant surface:
57
+
58
+ ```bash
59
+ npm run test:integration
60
+ npm run test:visual
61
+ npm run desktop:tauri:check
62
+ npm run release:artifacts
63
+ npm run release:validate
64
+ ```
65
+
66
+ ## Runtime Assembly
67
+
68
+ `latticeai.app_factory` is the composition root. Keep it import-safe:
69
+
70
+ - no MLX/GPU init at module import time;
71
+ - no singleton construction at module import time;
72
+ - no filesystem writes at module import time;
73
+ - no external network calls at module import time.
74
+
75
+ Runtime assembly seams live under `latticeai.runtime`:
76
+
77
+ - `config_runtime.py` derives app config values from `Config`;
78
+ - `security_runtime.py` applies trusted proxy/security-derived settings;
79
+ - `brain_runtime.py` constructs Brain Core and conversation primitives.
80
+
81
+ Future extraction should continue with router assembly, model runtime assembly,
82
+ platform/hooks assembly, static asset serving, and lifespan/startup/shutdown.
83
+
84
+ ## Documentation Sync
85
+
86
+ For user-facing, API, runtime, release, or packaging changes, check:
87
+
88
+ - `README.md`
89
+ - `ARCHITECTURE.md`
90
+ - `FEATURE_STATUS.md`
91
+ - `RELEASE.md`
92
+ - `docs/CHANGELOG.md`
93
+ - `SECURITY.md` when trust/security changes
94
+ - `vscode-extension/README.md` when editor integration changes
95
+ - `docs/LEGACY_COMPATIBILITY.md` when root compatibility files change
96
+
97
+ Release/publish examples must use exact target-version filenames. Do not
98
+ document wildcard upload commands such as `dist/*`.
99
+
@@ -0,0 +1,55 @@
1
+ # Legacy Compatibility Map
2
+
3
+ Lattice AI is moving toward a smaller, modular architecture centered on
4
+ `lattice_brain`, `latticeai.services`, `latticeai.api`, and `latticeai.runtime`.
5
+ Some root-level modules remain packaged for compatibility with older imports,
6
+ CLI entrypoints, or extension workflows. Their presence does not define the
7
+ current architecture.
8
+
9
+ ## Current Policy
10
+
11
+ - Keep compatibility shims while public imports or package entrypoints still
12
+ depend on them.
13
+ - Prefer moving implementation into focused packages before removing a root
14
+ module.
15
+ - Add deprecation notes before removal.
16
+ - Avoid breaking package users during a minor release.
17
+ - Do not silently remove rollback, backup, restore, or migration paths.
18
+
19
+ ## Root Module Map
20
+
21
+ | Legacy root module | Current home / direction | Why it remains |
22
+ | --- | --- | --- |
23
+ | `knowledge_graph.py` | `lattice_brain.graph` / `lattice_brain.knowledge` | Compatibility for older graph imports and historical tooling |
24
+ | `knowledge_graph_api.py` | `latticeai.api.memory`, `latticeai.api.search`, graph-related API routers | Compatibility for older API import paths |
25
+ | `kg_schema.py` | `lattice_brain` storage/schema modules | Compatibility for graph schema references |
26
+ | `auto_setup.py` | setup/model recommendation services | Compatibility for zero-config setup probes and historical auto-setup commands |
27
+ | `llm_router.py` | `latticeai.models.router` | Compatibility for older local model routing imports |
28
+ | `ltcai_cli.py` | package console entrypoint (`ltcai`) | Compatibility for the installed CLI contract |
29
+ | `mcp_registry.py` | `latticeai.core.mcp_registry` and service-backed registries | Compatibility for MCP/skills lookup entrypoints |
30
+ | `local_knowledge_api.py` | `lattice_brain.ingestion`, workspace capture APIs | Compatibility for local folder/file watcher flows |
31
+ | `p_reinforce.py` | gardener/maintenance service direction | Compatibility for existing Brain gardening runtime hooks |
32
+ | `telegram_bot.py` | opt-in integration package or disabled-by-default connector | Compatibility only; Telegram must remain opt-in |
33
+ | `setup_wizard.py` | setup and model recommendation services | Compatibility for first-run recommendation calls |
34
+ | `server.py` | lazy proxy to `latticeai.server_app` / `latticeai.app_factory` | Preserves historical `server.app` imports without import-time construction |
35
+
36
+ ## Packaging Notes
37
+
38
+ `pyproject.toml` and `package.json` still include several root modules because
39
+ older installed packages may import them directly. That is intentional for now.
40
+ The long-term target is:
41
+
42
+ - move implementation into `lattice_brain`, `latticeai.core`, `latticeai.models`,
43
+ `latticeai.services`, or `latticeai.api`;
44
+ - leave thin shims with docstrings/deprecation warnings;
45
+ - remove a shim only after tests prove no supported entrypoint relies on it.
46
+
47
+ ## Removal Checklist
48
+
49
+ Before removing or excluding a legacy module:
50
+
51
+ 1. Search imports in the repository and generated package files.
52
+ 2. Add or update a compatibility test.
53
+ 3. Confirm the package still imports from a fresh non-repo working directory.
54
+ 4. Update `README.md`, `ARCHITECTURE.md`, `FEATURE_STATUS.md`, and this file.
55
+ 5. Run unit tests, package build, and wheel smoke validation.
@@ -43,5 +43,5 @@ FastAPI backend compatibility, release artifacts, and installed-wheel smoke.
43
43
  `block v0.1.6`; the current Tauri 2.0 build passes on Rust 1.96.
44
44
  - Release artifact validation warns that historical artifacts remain in
45
45
  `dist/`; this is expected and reinforces the rule to upload only exact
46
- v4.1.0 filenames, never `dist/*`.
46
+ v4.1.0 filenames, never a wildcard from the `dist` directory.
47
47
  - No external registry publish was performed.
@@ -44,8 +44,8 @@ architecture.
44
44
  - Release artifact validation now checks the exact Tauri DMG path.
45
45
  - Release artifact build script cleans only target-version outputs before
46
46
  rebuilding.
47
- - Historical artifacts remain visible so `dist/*` upload mistakes are still
48
- detectable.
47
+ - Historical artifacts remain visible so wildcard upload mistakes from `dist`
48
+ are still detectable.
49
49
 
50
50
  ## Registry Policy
51
51
 
@@ -51,4 +51,5 @@ Expected exact-version artifacts:
51
51
 
52
52
  `npm run release:validate` confirmed all exact-version RC artifacts are present.
53
53
  It also warned that historical artifacts remain in `dist/`, so publish commands
54
- must continue to use explicit v4.5.1 filenames rather than a `dist/*` glob.
54
+ must continue to use explicit v4.5.1 filenames rather than a wildcard from the
55
+ `dist` directory.
@@ -1,6 +1,6 @@
1
1
  # Why Lattice AI Exists
2
2
 
3
- **Your private AI memory layer. Keep your knowledge. Switch any model.**
3
+ **Lattice AI is a local-first Digital Brain that keeps your knowledge durable across any AI model.**
4
4
 
5
5
  **모델은 바꿔도, 내 지식은 남는 로컬 AI 브레인.**
6
6
 
@@ -26,7 +26,9 @@ Lattice AI is a local-first private AI memory layer. It keeps conversations,
26
26
  documents, decisions, relationships, and project history in a Brain that belongs
27
27
  to the user. Models can be local, cloud, current, or future. The Brain remains.
28
28
 
29
- The graph is real, but it is not the product identity. Users start with Brain
29
+ The graph is real, but it is not the product identity. Product category is
30
+ local-first Digital Brain; core capability is a private AI memory layer; UX
31
+ metaphor is the Living Brain. Users start with Brain
30
32
  Chat, memory, topics, relationships, ownership, backup, and graph exploration.
31
33
  Advanced admin logs, roles, hooks, workflows, Telegram, Brain Network, Docker,
32
34
  Postgres, and plugin details stay outside the normal user flow.
@@ -51,4 +53,3 @@ Postgres, and plugin details stay outside the normal user flow.
51
53
  - Not a ChatGPT or Claude clone.
52
54
 
53
55
  Lattice AI is for people who want their knowledge to survive model changes.
54
-
@@ -36,11 +36,11 @@ export function FirstRunGuide() {
36
36
  const readyProfile = compatProfiles.some((item) => item.chat_compatible || item.quality_status === "ok" || item.quality_status === "degraded");
37
37
 
38
38
  const steps = [
39
- { label: "Make it yours", done: Boolean(profileData.email), icon: UserCircle, action: "account", detail: "Sign in or keep a local profile." },
39
+ { label: "Make it yours", done: Boolean(profileData.email), icon: UserCircle, action: "account", detail: "Choose the owner of this local AI Brain." },
40
40
  { label: "Choose a space", done: Boolean(registry.active_workspace || workspaceData.active_workspace), icon: Users, action: "workspace-admin", detail: "Decide where memories belong." },
41
- { label: "Meet your Mac", done: recs.isSuccess, icon: Cpu, action: "models", detail: "Let Lattice inspect what can run locally." },
42
- { label: "Pick a brain", done: Boolean(topPick || currentModel), icon: Library, action: "models", detail: "Use the recommended local model." },
43
- { label: "Install locally", done: Boolean(currentModel || loadedModels.length), icon: Download, action: "models", detail: "Download only with explicit consent." },
41
+ { label: "Meet your Mac", done: recs.isSuccess, icon: Cpu, action: "models", detail: "See what local Brain experience this computer can support." },
42
+ { label: "Pick a voice", done: Boolean(topPick || currentModel), icon: Library, action: "models", detail: "Use the recommended model without rebuilding memory later." },
43
+ { label: "Install with consent", done: Boolean(currentModel || loadedModels.length), icon: Download, action: "models", detail: "Download only after an explicit click." },
44
44
  { label: "Talk to Brain", done: Boolean(readyProfile || currentModel || loadedModels.length), icon: PlayCircle, action: "chat", detail: "Confirm the model can answer." },
45
45
  { label: "Set the pace", done: Boolean(mode), icon: SlidersHorizontal, action: "settings", detail: "Stay Calm or switch deeper." },
46
46
  { label: "Explore deeply", done: true, icon: Layers3, action: "knowledge-graph", detail: "Open advanced relationships." },
@@ -55,7 +55,7 @@ export function FirstRunGuide() {
55
55
  <div className="page-kicker"><CheckCircle2 className="h-4 w-4" /> First 10 minutes</div>
56
56
  <h2>Build your living Brain without guessing.</h2>
57
57
  <p>
58
- Start with a space, let Lattice recommend a private local model, then add the first pieces of knowledge.
58
+ Start with a local Brain, let Lattice recommend a model voice, then add the first pieces of durable knowledge.
59
59
  Every step keeps the next action visible.
60
60
  </p>
61
61
  <div className="arrival-actions">
@@ -531,7 +531,7 @@ function buildDetectedFacts(analysis: FlowAnalysis | null) {
531
531
  {
532
532
  label: "Computer",
533
533
  value: appleSilicon ? "Apple Silicon Mac" : friendlyOs(profile.os),
534
- detail: "Ready for local AI workspace use",
534
+ detail: "Ready for local Digital Brain use",
535
535
  },
536
536
  {
537
537
  label: "Memory",
@@ -13,11 +13,11 @@ export const COPY: Record<Language, TextMap> = {
13
13
  "language.ko": "한국어",
14
14
  "language.en": "English",
15
15
  "brain.level": "단계",
16
- "brain.depth.1": "Living Brain",
17
- "brain.depth.2": "Memory Layer",
18
- "brain.depth.3": "Knowledge Layer",
19
- "brain.depth.4": "Relationship Layer",
20
- "brain.depth.5": "Knowledge Graph",
16
+ "brain.depth.1": "지금 기억",
17
+ "brain.depth.2": "오래된 기억",
18
+ "brain.depth.3": "주제",
19
+ "brain.depth.4": "관계",
20
+ "brain.depth.5": "전체 지식 그래프",
21
21
  "brain.view.memories": "기억 보기",
22
22
  "brain.view.topics": "주제 보기",
23
23
  "brain.view.relationships": "관계 보기",
@@ -29,11 +29,11 @@ export const COPY: Record<Language, TextMap> = {
29
29
  "brain.private": "개인 소유",
30
30
  "brain.admin": "관리자 콘솔",
31
31
  "brain.empty.kicker": "내 오래가는 기억",
32
- "brain.empty.title": "잊으면 안 되는 일부터 말해 주세요.",
33
- "brain.empty.body": "문서, 대화, 프로젝트, 결정이 Brain에 쌓이고 나중에 주제와 관계로 다시 보입니다.",
34
- "brain.prompt.remember": "이 결정을 기억해줘: ",
35
- "brain.prompt.know": "내가 이미 알고 있는 것은? ",
36
- "brain.prompt.plan": " 프로젝트 맥락을 계획으로 바꿔줘: ",
32
+ "brain.empty.title": "잊으면 안 되는 맥락부터 말해 주세요.",
33
+ "brain.empty.body": "문서, 대화, 프로젝트, 결정이 이 컴퓨터의 Brain에 쌓이고 나중에 주제와 관계로 다시 보입니다.",
34
+ "brain.prompt.remember": "이 프로젝트 목표를 기억해줘: ",
35
+ "brain.prompt.know": " 문서를 Brain에 넣고 요약해줘: ",
36
+ "brain.prompt.plan": "지난 결정들을 나중에 찾을 있게 정리해줘: ",
37
37
  "brain.placeholder": "Brain에게 말하기...",
38
38
  "brain.image": "이미지",
39
39
  "brain.unavailable": "지금은 답할 수 없음",
@@ -75,16 +75,16 @@ export const COPY: Record<Language, TextMap> = {
75
75
  "admin.kicker": "분리된 관리자 작업공간",
76
76
  "admin.title": "Admin Console",
77
77
  "admin.body": "사용자, 로그, 보안, Brain 상태는 일반 사용자 화면과 분리됩니다.",
78
- "flow.shell": "내 로컬 Brain 만들기",
79
- "flow.login.title": "내 Brain을 시작합니다.",
80
- "flow.login.body": "모델은 바뀔 있지만,문서와 대화, 결정, 기억은 사라지면 됩니다. Lattice는 지식을 내가 소유하는 개인 Brain으로 모읍니다.",
78
+ "flow.shell": "내 로컬 AI 브레인 만들기",
79
+ "flow.login.title": "내 AI 브레인의 주인을 정합니다.",
80
+ "flow.login.body": "Lattice AI는 모델이 바뀌어도지식과 맥락을 보존하는 로컬 우선 AI 브레인입니다. 대화와 기억은 기본적으로 컴퓨터에 저장됩니다.",
81
81
  "flow.name": "이름",
82
82
  "flow.email": "이메일",
83
83
  "flow.password": "비밀번호",
84
84
  "flow.password.placeholder": "로컬 Brain 비밀번호",
85
85
  "flow.login.busy": "Brain 여는 중...",
86
86
  "flow.login.submit": "내 Brain 시작하기",
87
- "flow.login.note": "기존 Brain과 다른 이메일이면 새로 만들지 않고 먼저 확인합니다.",
87
+ "flow.login.note": "이 프로필은 내 AI 브레인의 주인입니다. 기존 Brain과 다른 이메일이면 새로 만들지 않고 먼저 확인합니다.",
88
88
  "flow.login.missing": "이름과 이메일, 비밀번호를 입력하면 기존 Brain을 안전하게 확인합니다.",
89
89
  "flow.login.otherEmail": "이 컴퓨터의 기존 Brain과 다른 이메일입니다. 오타인지 확인해 주세요.",
90
90
  "flow.login.wrongPassword": "기존 Brain 이메일은 맞지만 비밀번호가 다릅니다. 비밀번호를 다시 확인해 주세요.",
@@ -95,21 +95,21 @@ export const COPY: Record<Language, TextMap> = {
95
95
  "flow.promise.model.v": "모델은 목소리이고, 자산은 Brain입니다.",
96
96
  "flow.promise.ownership.k": "사용자 소유",
97
97
  "flow.promise.ownership.v": "백업, 복원, 이동이 가능합니다.",
98
- "flow.analysis.title": "이 컴퓨터를 확인합니다.",
99
- "flow.analysis.body": "Brain클라우드에 의존하지 않고 컴퓨터에서 편하게 돌아갈 있는지 확인합니다.",
98
+ "flow.analysis.title": "이 컴퓨터에서 가능한 경험을 확인합니다.",
99
+ "flow.analysis.body": "스펙 점수가 아니라, Mac에서 어떤 로컬 AI 브레인 경험이 편한지 알려드립니다. 클라우드 모델은 선택 사항입니다.",
100
100
  "flow.analysis.finding": "가장 편한 설정을 찾는 중...",
101
101
  "flow.analysis.ready": "추천 모델을 바로 시작할 수 있게 준비했습니다.",
102
102
  "flow.analysis.wait": "잠시만 기다리면 자동으로 정리됩니다.",
103
103
  "flow.analysis.error": "Lattice가 이 컴퓨터를 끝까지 확인하지 못했습니다. 그래도 안전한 기본값으로 계속할 수 있습니다.",
104
104
  "flow.analysis.continue": "추천 모델 보기",
105
- "flow.recommend.title": "추천 모델로 시작하세요.",
106
- "flow.recommend.body": "모델은 Brain의 현재 목소리입니다. 나중에 바꿔도 기억과 지식은 그대로 남습니다.",
105
+ "flow.recommend.title": "추천대로 시작하세요.",
106
+ "flow.recommend.body": "모델은 Brain의 현재 목소리입니다. 가장 안전한 추천, 빠른 모델, 더 강한 모델만 먼저 보여드립니다.",
107
107
  "flow.recommend.primary": "추천대로 시작하기",
108
108
  "flow.recommend.unsupported": "이 컴퓨터에서 추가 확인이 필요합니다",
109
109
  "flow.recommend.back": "뒤로",
110
110
  "flow.recommend.hint": "잘 모르겠다면 추천대로 시작하면 됩니다.",
111
111
  "flow.install.title": "모델을 설치하고 시작합니다.",
112
- "flow.install.body": "이 모델이 Brain의 로컬 목소리가 됩니다. 다운로드, 확인, 로드는 사용자가 누른 뒤에만 진행됩니다.",
112
+ "flow.install.body": "이 모델이 Brain의 로컬 목소리가 됩니다. 다운로드할 때만 인터넷이 필요하고, 실행은 컴퓨터에서 진행됩니다.",
113
113
  "flow.install.wait": "Brain이 사용할 모델을 기다리고 있습니다.",
114
114
  "flow.install.prepare": "Brain 준비 중입니다.",
115
115
  "flow.install.done": "Brain이 준비되었습니다.",
@@ -119,18 +119,18 @@ export const COPY: Record<Language, TextMap> = {
119
119
  "flow.install.start": "다운로드하고 시작하기",
120
120
  "flow.install.busy": "모델 준비 중...",
121
121
  "flow.install.enter": "Brain으로 들어가기",
122
- "flow.install.local": "모든 작업은 컴퓨터에서 진행됩니다.",
122
+ "flow.install.local": "모델 다운로드와 외부 통신은 사용자가 시작할 때만 진행됩니다.",
123
123
  },
124
124
  en: {
125
125
  "language.label": "Language",
126
126
  "language.ko": "한국어",
127
127
  "language.en": "English",
128
128
  "brain.level": "Level",
129
- "brain.depth.1": "Living Brain",
130
- "brain.depth.2": "Memory Layer",
131
- "brain.depth.3": "Knowledge Layer",
132
- "brain.depth.4": "Relationship Layer",
133
- "brain.depth.5": "Knowledge Graph",
129
+ "brain.depth.1": "Now memory",
130
+ "brain.depth.2": "Older memory",
131
+ "brain.depth.3": "Topics",
132
+ "brain.depth.4": "Relationships",
133
+ "brain.depth.5": "Full knowledge graph",
134
134
  "brain.view.memories": "Memories",
135
135
  "brain.view.topics": "Topics",
136
136
  "brain.view.relationships": "Relationships",
@@ -142,11 +142,11 @@ export const COPY: Record<Language, TextMap> = {
142
142
  "brain.private": "Private",
143
143
  "brain.admin": "Admin Console",
144
144
  "brain.empty.kicker": "Durable memory",
145
- "brain.empty.title": "Start with what should not be forgotten.",
146
- "brain.empty.body": "Documents, conversations, projects, and decisions accumulate in your Brain, then reappear as topics and relationships.",
147
- "brain.prompt.remember": "Remember this decision: ",
148
- "brain.prompt.know": "What do I already know about ",
149
- "brain.prompt.plan": "Turn this project context into a plan: ",
145
+ "brain.empty.title": "Start with context that should not be forgotten.",
146
+ "brain.empty.body": "Documents, conversations, projects, and decisions accumulate in the Brain on this computer, then reappear as topics and relationships.",
147
+ "brain.prompt.remember": "Remember this project goal: ",
148
+ "brain.prompt.know": "Put this document into my Brain and summarize it: ",
149
+ "brain.prompt.plan": "Organize past decisions so I can find them later: ",
150
150
  "brain.placeholder": "Talk to your Brain...",
151
151
  "brain.image": "Image",
152
152
  "brain.unavailable": "Unavailable",
@@ -188,16 +188,16 @@ export const COPY: Record<Language, TextMap> = {
188
188
  "admin.kicker": "Separate admin workspace",
189
189
  "admin.title": "Admin Console",
190
190
  "admin.body": "Users, logs, security, and Brain health stay out of the normal user experience.",
191
- "flow.shell": "Create your local Brain",
192
- "flow.login.title": "Start your Brain.",
193
- "flow.login.body": "Models can change, but your documents, conversations, decisions, and memories should stay yours. Lattice gathers them into a personal Brain you control.",
191
+ "flow.shell": "Create your local AI Brain",
192
+ "flow.login.title": "Choose the owner of your AI Brain.",
193
+ "flow.login.body": "Lattice AI is a local-first Digital Brain that keeps your knowledge durable across any AI model. Conversations and memories are stored on this computer by default.",
194
194
  "flow.name": "Name",
195
195
  "flow.email": "Email",
196
196
  "flow.password": "Password",
197
197
  "flow.password.placeholder": "Local Brain password",
198
198
  "flow.login.busy": "Opening Brain...",
199
199
  "flow.login.submit": "Start my Brain",
200
- "flow.login.note": "If the email differs from this computer's Brain, Lattice checks before creating anything new.",
200
+ "flow.login.note": "This profile owns your AI Brain. If the email differs from this computer's Brain, Lattice checks before creating anything new.",
201
201
  "flow.login.missing": "Enter your name, email, and password so Lattice can safely check your Brain.",
202
202
  "flow.login.otherEmail": "This email differs from the Brain on this computer. Please check for a typo.",
203
203
  "flow.login.wrongPassword": "The email matches this Brain, but the password is different. Please check it again.",
@@ -208,21 +208,21 @@ export const COPY: Record<Language, TextMap> = {
208
208
  "flow.promise.model.v": "The model is the voice; the Brain is the asset.",
209
209
  "flow.promise.ownership.k": "User owned",
210
210
  "flow.promise.ownership.v": "Back up, restore, and move it.",
211
- "flow.analysis.title": "Checking this computer.",
212
- "flow.analysis.body": "Lattice checks whether your Brain can run comfortably on this computer without depending on the cloud.",
211
+ "flow.analysis.title": "Checking what this computer can do.",
212
+ "flow.analysis.body": "This is not a spec test. Lattice explains what local AI Brain experience this Mac can support. Cloud models remain optional.",
213
213
  "flow.analysis.finding": "Finding the easiest setup...",
214
214
  "flow.analysis.ready": "Your recommended model is ready to start.",
215
215
  "flow.analysis.wait": "This will be summarized automatically in a moment.",
216
216
  "flow.analysis.error": "Lattice could not finish checking this computer. You can still continue with a safe default.",
217
217
  "flow.analysis.continue": "View recommended models",
218
- "flow.recommend.title": "Start with the recommended model.",
219
- "flow.recommend.body": "The model is your Brain's current voice. You can change it later without losing memory or knowledge.",
218
+ "flow.recommend.title": "Start with the recommendation.",
219
+ "flow.recommend.body": "The model is your Brain's current voice. You see the safest recommendation, a faster model, and a stronger model first.",
220
220
  "flow.recommend.primary": "Start with recommendation",
221
221
  "flow.recommend.unsupported": "This computer needs one more check",
222
222
  "flow.recommend.back": "Back",
223
223
  "flow.recommend.hint": "If unsure, start with the recommendation.",
224
224
  "flow.install.title": "Install the model and start.",
225
- "flow.install.body": "This model becomes your Brain's local voice. Download, validation, and loading begin only after you choose to start.",
225
+ "flow.install.body": "This model becomes your Brain's local voice. Internet is needed only for download; execution happens on this computer.",
226
226
  "flow.install.wait": "Waiting for the model your Brain will use.",
227
227
  "flow.install.prepare": "Preparing your Brain.",
228
228
  "flow.install.done": "Your Brain is ready.",
@@ -232,7 +232,7 @@ export const COPY: Record<Language, TextMap> = {
232
232
  "flow.install.start": "Download and start",
233
233
  "flow.install.busy": "Preparing model...",
234
234
  "flow.install.enter": "Enter Brain",
235
- "flow.install.local": "Everything runs on this computer.",
235
+ "flow.install.local": "Downloads and external communication start only when you choose them.",
236
236
  },
237
237
  };
238
238
 
@@ -30,8 +30,8 @@ export function LibraryPage({ initialTab }: { initialTab?: string }) {
30
30
  <div className="space-y-5">
31
31
  <header className="page-hero">
32
32
  <div className="page-kicker"><Boxes className="h-4 w-4" /> Library</div>
33
- <h1 className="page-title">Choose what powers Lattice.</h1>
34
- <p className="page-copy">Pick a private local model, add skills, and connect tools without learning runtime internals.</p>
33
+ <h1 className="page-title">Choose your Brain's voice.</h1>
34
+ <p className="page-copy">Start with a short local model recommendation. Your Brain and memories stay durable when you switch later.</p>
35
35
  </header>
36
36
  <Tabs tabs={visibleTabs} value={tab} onChange={(id) => setTab(id as LibraryTab)} />
37
37
  {tab === "models" ? <ModelsPanel /> : null}
@@ -103,7 +103,7 @@ function ModelsPanel() {
103
103
  return (
104
104
  <div className="grid gap-4 xl:grid-cols-[1.2fr_0.8fr]">
105
105
  <div className="space-y-4">
106
- <DataPanel title="Guided model setup" description="Analyze this Mac, recommend a model, install only with consent, validate it, then load it." result={recs.data}>
106
+ <DataPanel title="Guided model setup" description="Lattice recommends a small set first, explains internet/download needs, and keeps every model download behind consent." result={recs.data}>
107
107
  {(data) => {
108
108
  const recommendation = (data as Record<string, unknown>).recommendations as Record<string, unknown> | undefined;
109
109
  const profile = (data as Record<string, unknown>).profile as Record<string, unknown> | undefined;
@@ -134,7 +134,7 @@ function ModelsPanel() {
134
134
  <label className="flex items-start gap-2 rounded-lg border border-border bg-background/55 p-3 text-sm leading-6">
135
135
  <input className="mt-1" type="checkbox" checked={consent} onChange={(event) => setConsent(event.target.checked)} />
136
136
  <span>
137
- Allow Lattice to install a missing local model component or download model files for this action.
137
+ Allow Lattice to install a missing local model component or download model files for this action. Download uses the internet; running the model stays local.
138
138
  </span>
139
139
  </label>
140
140
  {latestProgress ? (
@@ -151,15 +151,22 @@ function ModelsPanel() {
151
151
  );
152
152
  }}
153
153
  </DataPanel>
154
- <DataPanel title="Recommended models" result={models.data}>
154
+ <DataPanel title={mode === "basic" ? "Recommended models" : "Recommended and advanced models"} result={models.data}>
155
155
  {(data) => (
156
156
  <div className="grid gap-2">
157
- {(catalog.length ? catalog : asArray<Record<string, unknown>>((data as Record<string, unknown>).loaded)).slice(0, 14).map((model, index) => {
157
+ {(catalog.length ? catalog : asArray<Record<string, unknown>>((data as Record<string, unknown>).loaded)).slice(0, mode === "basic" ? 3 : 14).map((model, index) => {
158
158
  const id = String(model.id || model.model_id || model.name || index);
159
159
  const loaded = asArray<string>((data as Record<string, unknown>).loaded).includes(id) || (data as Record<string, unknown>).current === id || model.state === "loaded";
160
160
  const loadId = String(model.recommended_load_id || id);
161
161
  const engine = String(model.recommended_engine || model.engine || "");
162
162
  const recommendation = recommendationById.get(id) || recommendationById.get(loadId) || {};
163
+ const modelVerification = asRecord(model.verification);
164
+ const recommendationVerification = asRecord(recommendation.verification);
165
+ const modelHardware = asRecord(model.hardware);
166
+ const recommendationHardware = asRecord(recommendation.hardware);
167
+ const hardwareNote = modelHardware.notes || recommendationHardware.notes || (modelHardware.recommended_ram_gb ? `~${modelHardware.recommended_ram_gb}GB RAM rec` : "");
168
+ const safetyNotes = model.safety_notes || recommendation.safety_notes;
169
+ const licenseText = model.license || recommendation.license;
163
170
  const compatibility = (model.runtime_compatibility || recommendation.runtime_compatibility || {}) as Record<string, unknown>;
164
171
  const fallbackAvailable = String(compatibility.status || "") === "fallback_available";
165
172
  const unsupported = model.load_status === "unsupported" || compatibility.supported === false;
@@ -171,12 +178,16 @@ function ModelsPanel() {
171
178
  const actionLabel = String(compatibility.action || loadStatus.replace(/_/g, " "));
172
179
  const badgeLabel = unsupported && mode === "basic" ? "needs attention" : unsupported ? actionLabel : loadStatus;
173
180
  const canPrepare = loadAvailable || downloadRequired;
181
+ const downloadSize = model.download_size || model.estimated_size || recommendation.download_size || recommendation.estimated_size || model.size || recommendation.size;
182
+ const maker = model.provider || recommendation.provider || model.organization || recommendation.organization;
174
183
  return (
175
184
  <div key={id} className="grid gap-3 rounded-lg border border-border bg-background/55 p-4 md:grid-cols-[1fr_auto]">
176
185
  <div className="min-w-0">
177
186
  <div className="flex flex-wrap items-center gap-2">
178
187
  <div className="text-base font-semibold">{String(model.name || id)}</div>
179
- {topPick?.id === id ? <Badge variant="success">recommended</Badge> : null}
188
+ {topPick?.id === id || model.recommended_default ? <Badge variant="success">recommended</Badge> : null}
189
+ {String(model.modality || recommendation.modality || "").includes("multi") || String(model.modality || "") === "multimodal" ? <Badge variant="muted">multimodal</Badge> : null}
190
+ {modelVerification.verified || recommendationVerification.verified ? <Badge variant="success" title="HF verified (config+tokenizer present)">✓ HF</Badge> : null}
180
191
  </div>
181
192
  <div className="mt-1 text-sm text-muted-foreground">
182
193
  {mode === "basic"
@@ -186,6 +197,16 @@ function ModelsPanel() {
186
197
  ].filter(Boolean).map(String).join(" · ")
187
198
  : [model.family || recommendation.family || "local", model.size || recommendation.size].filter(Boolean).map(String).join(" · ")}
188
199
  </div>
200
+ {(model.hardware || recommendation.hardware) ? (
201
+ <div className="mt-1 text-[11px] text-muted-foreground/80">
202
+ {String(hardwareNote)}
203
+ </div>
204
+ ) : null}
205
+ <div className="mt-2 flex flex-wrap gap-1 text-[11px] text-muted-foreground">
206
+ <Badge variant="muted">{downloadRequired ? `Download: ${String(downloadSize || "required")}` : "No download needed now"}</Badge>
207
+ <Badge variant="muted">{downloadRequired ? "Internet only during download" : "Runs locally when loaded"}</Badge>
208
+ {maker ? <Badge variant="muted">{String(maker)}</Badge> : null}
209
+ </div>
189
210
  {unsupported ? (
190
211
  <div className="mt-3 rounded-lg border border-amber-500/30 bg-amber-500/10 p-3 text-sm">
191
212
  <div className="font-medium">{mode === "basic" ? "Needs attention before loading" : actionLabel}</div>
@@ -198,8 +219,15 @@ function ModelsPanel() {
198
219
  </div>
199
220
  ) : !loaded && !loadAvailable ? <div className="mt-1 text-xs text-muted-foreground">{unavailableReason}</div> : null}
200
221
  {mode !== "basic" ? (
201
- <div className="mt-2 text-xs text-muted-foreground">
202
- {runtimeLabel} · {loadId}
222
+ <div className="mt-2 space-y-1 text-xs text-muted-foreground">
223
+ <div>
224
+ {runtimeLabel} · {loadId}
225
+ {model.load_strategy || recommendation.load_strategy ? ` · ${String(model.load_strategy || recommendation.load_strategy)}` : ""}
226
+ {modelVerification.notes ? ` · ${String(modelVerification.notes).slice(0,60)}` : ""}
227
+ </div>
228
+ {safetyNotes || licenseText ? (
229
+ <div>{[licenseText ? `License: ${String(licenseText)}` : "", safetyNotes ? String(safetyNotes) : ""].filter(Boolean).join(" · ")}</div>
230
+ ) : null}
203
231
  </div>
204
232
  ) : null}
205
233
  {unsupported || fallbackAvailable ? <AlternativeModels compatibility={compatibility} /> : null}
@@ -221,6 +249,11 @@ function ModelsPanel() {
221
249
  </div>
222
250
  );
223
251
  })}
252
+ {mode === "basic" && catalog.length > 3 ? (
253
+ <div className="rounded-lg border border-border bg-background/55 p-3 text-sm text-muted-foreground">
254
+ Showing the safest short list. Switch to Advanced for the full registry, runtime details, licenses, and safety notes.
255
+ </div>
256
+ ) : null}
224
257
  </div>
225
258
  )}
226
259
  </DataPanel>
@@ -277,6 +310,10 @@ function ModelRecovery({ error }: { error: Record<string, unknown> }) {
277
310
  );
278
311
  }
279
312
 
313
+ function asRecord(value: unknown): Record<string, unknown> {
314
+ return value && typeof value === "object" && !Array.isArray(value) ? value as Record<string, unknown> : {};
315
+ }
316
+
280
317
  function SkillsPanel() {
281
318
  const qc = useQueryClient();
282
319
  const skills = useQuery({ queryKey: ["skills"], queryFn: latticeApi.skills });
@@ -26,7 +26,7 @@ from .storage import (
26
26
  storage_from_env,
27
27
  )
28
28
 
29
- __version__ = "5.1.0"
29
+ __version__ = "5.3.0"
30
30
 
31
31
  __all__ = [
32
32
  "AgentRuntime",
@@ -14,6 +14,7 @@ import io
14
14
  import json
15
15
  import os
16
16
  import shutil
17
+ import sqlite3
17
18
  import tempfile
18
19
  import zipfile
19
20
  from dataclasses import dataclass
@@ -111,6 +112,16 @@ def _sqlite_siblings(db_path: Path) -> tuple[Path, Path, Path]:
111
112
  return (db_path, Path(str(db_path) + "-wal"), Path(str(db_path) + "-shm"))
112
113
 
113
114
 
115
+ def _checkpoint_sqlite(db_path: Path) -> None:
116
+ if not db_path.exists():
117
+ return
118
+ try:
119
+ with sqlite3.connect(str(db_path)) as conn:
120
+ conn.execute("PRAGMA wal_checkpoint(FULL)")
121
+ except sqlite3.Error:
122
+ return
123
+
124
+
114
125
  def _restore_sibling(path: Path, backup: Path) -> None:
115
126
  if backup.exists():
116
127
  shutil.copy2(backup, path)
@@ -124,6 +135,7 @@ def _replace_sqlite_atomically(src: Path, dest: Path, backup_dir: Path) -> None:
124
135
  shutil.copyfile(src, tmp)
125
136
  backups: dict[Path, Path] = {}
126
137
  try:
138
+ _checkpoint_sqlite(dest)
127
139
  for sibling in _sqlite_siblings(dest):
128
140
  if sibling.exists():
129
141
  backup = backup_dir / sibling.name