ltcai 9.0.0 → 9.2.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 (189) hide show
  1. package/README.md +88 -46
  2. package/auto_setup.py +7 -853
  3. package/desktop/electron/README.md +9 -0
  4. package/desktop/electron/main.cjs +5 -3
  5. package/docs/CHANGELOG.md +178 -2
  6. package/docs/COMMUNITY_AND_PLUGINS.md +4 -2
  7. package/docs/DEVELOPMENT.md +53 -14
  8. package/docs/LEGACY_COMPATIBILITY.md +4 -4
  9. package/docs/ONBOARDING.md +10 -2
  10. package/docs/OPERATIONS.md +8 -4
  11. package/docs/PRODUCT_DIRECTION_REVIEW.md +4 -0
  12. package/docs/TRUST_MODEL.md +5 -2
  13. package/docs/WHY_LATTICE.md +15 -10
  14. package/docs/WORKFLOW_DESIGNER.md +22 -0
  15. package/docs/kg-schema.md +13 -2
  16. package/docs/mcp-tools.md +17 -6
  17. package/docs/privacy.md +19 -3
  18. package/docs/public-deploy.md +32 -3
  19. package/docs/security-model.md +46 -11
  20. package/lattice_brain/__init__.py +1 -1
  21. package/lattice_brain/archive.py +1 -6
  22. package/lattice_brain/context.py +66 -9
  23. package/lattice_brain/graph/_kg_fsutil.py +1 -5
  24. package/lattice_brain/graph/discovery_index.py +174 -20
  25. package/lattice_brain/graph/documents.py +44 -9
  26. package/lattice_brain/graph/ingest.py +47 -20
  27. package/lattice_brain/graph/provenance.py +13 -6
  28. package/lattice_brain/graph/retrieval.py +140 -39
  29. package/lattice_brain/graph/retrieval_docgen.py +37 -4
  30. package/lattice_brain/ingestion.py +4 -7
  31. package/lattice_brain/portability.py +28 -14
  32. package/lattice_brain/runtime/agent_runtime.py +5 -9
  33. package/lattice_brain/runtime/hooks.py +30 -13
  34. package/lattice_brain/runtime/multi_agent.py +27 -8
  35. package/lattice_brain/runtime/statuses.py +10 -0
  36. package/lattice_brain/utils.py +20 -2
  37. package/lattice_brain/workflow.py +1 -5
  38. package/latticeai/__init__.py +1 -1
  39. package/latticeai/api/admin.py +1 -1
  40. package/latticeai/api/agent_registry.py +10 -8
  41. package/latticeai/api/agents.py +22 -3
  42. package/latticeai/api/auth.py +78 -16
  43. package/latticeai/api/browser.py +303 -34
  44. package/latticeai/api/chat.py +320 -850
  45. package/latticeai/api/chat_agent_http.py +356 -0
  46. package/latticeai/api/chat_contracts.py +54 -0
  47. package/latticeai/api/chat_documents.py +256 -0
  48. package/latticeai/api/chat_helpers.py +28 -1
  49. package/latticeai/api/chat_history.py +99 -0
  50. package/latticeai/api/chat_intents.py +316 -0
  51. package/latticeai/api/chat_stream.py +115 -0
  52. package/latticeai/api/computer_use.py +62 -9
  53. package/latticeai/api/health.py +9 -3
  54. package/latticeai/api/hooks.py +17 -6
  55. package/latticeai/api/knowledge_graph.py +78 -14
  56. package/latticeai/api/local_files.py +7 -2
  57. package/latticeai/api/mcp.py +102 -23
  58. package/latticeai/api/models.py +72 -33
  59. package/latticeai/api/network.py +5 -5
  60. package/latticeai/api/permissions.py +67 -26
  61. package/latticeai/api/plugins.py +21 -7
  62. package/latticeai/api/portability.py +5 -5
  63. package/latticeai/api/realtime.py +33 -5
  64. package/latticeai/api/setup.py +2 -2
  65. package/latticeai/api/static_routes.py +123 -24
  66. package/latticeai/api/tools.py +96 -14
  67. package/latticeai/api/workflow_designer.py +37 -0
  68. package/latticeai/api/workspace.py +2 -1
  69. package/latticeai/app_factory.py +110 -52
  70. package/latticeai/core/agent.py +50 -13
  71. package/latticeai/core/agent_prompts.py +5 -0
  72. package/latticeai/core/agent_registry.py +1 -5
  73. package/latticeai/core/config.py +23 -3
  74. package/latticeai/core/context_builder.py +21 -3
  75. package/latticeai/core/file_generation.py +451 -0
  76. package/latticeai/core/invitations.py +1 -4
  77. package/latticeai/core/io_utils.py +9 -1
  78. package/latticeai/core/legacy_compatibility.py +24 -3
  79. package/latticeai/core/marketplace.py +1 -1
  80. package/latticeai/core/plugins.py +15 -0
  81. package/latticeai/core/policy.py +1 -1
  82. package/latticeai/core/realtime.py +38 -15
  83. package/latticeai/core/sessions.py +7 -2
  84. package/latticeai/core/timeutil.py +10 -0
  85. package/latticeai/core/tool_registry.py +90 -18
  86. package/latticeai/core/users.py +1 -5
  87. package/latticeai/core/workspace_graph_trace.py +31 -5
  88. package/latticeai/core/workspace_memory.py +3 -1
  89. package/latticeai/core/workspace_os.py +18 -7
  90. package/latticeai/core/workspace_os_utils.py +0 -5
  91. package/latticeai/core/workspace_permissions.py +2 -1
  92. package/latticeai/core/workspace_plugins.py +1 -1
  93. package/latticeai/core/workspace_runs.py +14 -5
  94. package/latticeai/core/workspace_skills.py +1 -1
  95. package/latticeai/core/workspace_snapshots.py +2 -1
  96. package/latticeai/core/workspace_timeline.py +2 -1
  97. package/latticeai/integrations/telegram_bot.py +94 -43
  98. package/latticeai/models/router.py +130 -36
  99. package/latticeai/runtime/access_runtime.py +62 -4
  100. package/latticeai/runtime/automation_runtime.py +13 -7
  101. package/latticeai/runtime/brain_runtime.py +19 -7
  102. package/latticeai/runtime/chat_wiring.py +2 -0
  103. package/latticeai/runtime/config_runtime.py +58 -26
  104. package/latticeai/runtime/context_runtime.py +16 -4
  105. package/latticeai/runtime/hooks_runtime.py +1 -1
  106. package/latticeai/runtime/model_wiring.py +33 -5
  107. package/latticeai/runtime/namespace_runtime.py +62 -72
  108. package/latticeai/runtime/platform_runtime_wiring.py +4 -3
  109. package/latticeai/runtime/review_wiring.py +1 -1
  110. package/latticeai/runtime/router_registration.py +34 -1
  111. package/latticeai/runtime/security_runtime.py +110 -13
  112. package/latticeai/runtime/stages.py +27 -0
  113. package/latticeai/server_app.py +5 -1
  114. package/latticeai/services/architecture_readiness.py +74 -5
  115. package/latticeai/services/brain_automation.py +3 -26
  116. package/latticeai/services/chat_service.py +205 -15
  117. package/latticeai/services/local_knowledge.py +423 -0
  118. package/latticeai/services/memory_service.py +55 -21
  119. package/latticeai/services/model_engines.py +48 -33
  120. package/latticeai/services/model_errors.py +17 -0
  121. package/latticeai/services/model_loading.py +28 -25
  122. package/latticeai/services/model_runtime.py +228 -162
  123. package/latticeai/services/p_reinforce.py +22 -3
  124. package/latticeai/services/platform_runtime.py +83 -23
  125. package/latticeai/services/product_readiness.py +19 -17
  126. package/latticeai/services/review_queue.py +12 -0
  127. package/latticeai/services/router_context.py +1 -0
  128. package/latticeai/services/run_executor.py +4 -9
  129. package/latticeai/services/search_service.py +203 -28
  130. package/latticeai/services/tool_dispatch.py +28 -5
  131. package/latticeai/services/triggers.py +53 -4
  132. package/latticeai/services/upload_service.py +13 -2
  133. package/latticeai/setup/__init__.py +25 -0
  134. package/latticeai/setup/auto_setup.py +857 -0
  135. package/latticeai/setup/wizard.py +1264 -0
  136. package/latticeai/tools/__init__.py +278 -0
  137. package/{tools → latticeai/tools}/commands.py +67 -7
  138. package/{tools → latticeai/tools}/computer.py +1 -1
  139. package/{tools → latticeai/tools}/documents.py +1 -1
  140. package/{tools → latticeai/tools}/filesystem.py +3 -3
  141. package/latticeai/tools/knowledge.py +178 -0
  142. package/{tools → latticeai/tools}/local_files.py +1 -1
  143. package/{tools → latticeai/tools}/network.py +0 -1
  144. package/local_knowledge_api.py +4 -342
  145. package/package.json +22 -2
  146. package/scripts/brain_quality_eval.py +3 -1
  147. package/scripts/bump_version.py +3 -0
  148. package/scripts/capture_release_evidence.mjs +180 -0
  149. package/scripts/check_current_release_docs.mjs +142 -0
  150. package/scripts/check_i18n_literals.mjs +107 -31
  151. package/scripts/check_openapi_drift.mjs +56 -0
  152. package/scripts/export_openapi.py +67 -7
  153. package/scripts/i18n_literal_allowlist.json +22 -24
  154. package/scripts/run_integration_tests.mjs +72 -10
  155. package/scripts/validate_release_artifacts.py +49 -7
  156. package/scripts/wheel_smoke.py +5 -0
  157. package/setup_wizard.py +3 -1260
  158. package/src-tauri/Cargo.lock +1 -1
  159. package/src-tauri/Cargo.toml +1 -1
  160. package/src-tauri/tauri.conf.json +1 -1
  161. package/static/app/asset-manifest.json +11 -11
  162. package/static/app/assets/Act-C3dBrWE-.js +1 -0
  163. package/static/app/assets/Brain-DBYgdcjt.js +321 -0
  164. package/static/app/assets/Capture-Cf3hqRtN.js +1 -0
  165. package/static/app/assets/Library-CFfkNn3s.js +1 -0
  166. package/static/app/assets/System-BOurbT-v.js +1 -0
  167. package/static/app/assets/index-A3M9sElj.js +17 -0
  168. package/static/app/assets/index-Bmx9rzTc.css +2 -0
  169. package/static/app/assets/primitives-DcUUmhdC.js +1 -0
  170. package/static/app/assets/textarea-BklR6zN4.js +1 -0
  171. package/static/app/index.html +2 -2
  172. package/static/sw.js +1 -1
  173. package/tools/__init__.py +21 -269
  174. package/docs/CODE_REVIEW_2026-07-06.md +0 -764
  175. package/latticeai/runtime/app_context_runtime.py +0 -13
  176. package/latticeai/runtime/tail_wiring.py +0 -21
  177. package/scripts/com.pts.claudecode.discord.plist +0 -31
  178. package/scripts/pts-claudecode-discord-bridge.mjs +0 -207
  179. package/scripts/start-pts-claudecode-discord.sh +0 -51
  180. package/static/app/assets/Act-21lIXx2E.js +0 -1
  181. package/static/app/assets/Brain-BqUd5UJJ.js +0 -321
  182. package/static/app/assets/Capture-BA7Z2Q1u.js +0 -1
  183. package/static/app/assets/Library-bFMtyni3.js +0 -1
  184. package/static/app/assets/System-K6krGCqn.js +0 -1
  185. package/static/app/assets/index-C4R3ws30.js +0 -17
  186. package/static/app/assets/index-ChSeOB02.css +0 -2
  187. package/static/app/assets/primitives-sQU3it5I.js +0 -1
  188. package/static/app/assets/textarea-DK3Fd_lR.js +0 -1
  189. package/tools/knowledge.py +0 -95
@@ -0,0 +1,9 @@
1
+ # Electron compatibility shell
2
+
3
+ Electron is an experimental compatibility client. The supported desktop build
4
+ is the Tauri application in `src-tauri/`; release artifacts and validation use
5
+ that path. Electron shares the standard local backend at `127.0.0.1:4825` and
6
+ can be launched for development with `npm run desktop:electron`.
7
+
8
+ Override the backend only for development with
9
+ `LATTICEAI_DESKTOP_BACKEND_ORIGIN` or `LATTICEAI_DESKTOP_BACKEND_CMD`.
@@ -2,7 +2,9 @@ const { app, BrowserWindow, dialog, ipcMain } = require("electron");
2
2
  const { spawn } = require("node:child_process");
3
3
  const path = require("node:path");
4
4
 
5
- const origin = process.env.LATTICEAI_DESKTOP_BACKEND_ORIGIN || "http://127.0.0.1:8765";
5
+ // Experimental compatibility shell. Tauri is the primary desktop client; use
6
+ // the same backend port as every other Lattice client to avoid split defaults.
7
+ const origin = process.env.LATTICEAI_DESKTOP_BACKEND_ORIGIN || "http://127.0.0.1:4825";
6
8
  let backend = null;
7
9
 
8
10
  ipcMain.handle("lattice:select-folder", async (event) => {
@@ -18,12 +20,12 @@ ipcMain.handle("lattice:select-folder", async (event) => {
18
20
 
19
21
  function startBackend() {
20
22
  if (process.env.LATTICEAI_DESKTOP_NO_BACKEND) return;
21
- const command = process.env.LATTICEAI_DESKTOP_BACKEND_CMD || "python3 ltcai_cli.py --host 127.0.0.1 --port 8765";
23
+ const command = process.env.LATTICEAI_DESKTOP_BACKEND_CMD || "python3 ltcai_cli.py --host 127.0.0.1 --port 4825";
22
24
  const [bin, ...args] = command.split(/\s+/).filter(Boolean);
23
25
  if (!bin) return;
24
26
  backend = spawn(bin, args, {
25
27
  cwd: process.env.LATTICEAI_DESKTOP_BACKEND_CWD || path.resolve(__dirname, "../.."),
26
- env: { ...process.env, LATTICEAI_HOST: "127.0.0.1", LATTICEAI_PORT: "8765", LATTICEAI_TUNNEL: "false" },
28
+ env: { ...process.env, LATTICEAI_HOST: "127.0.0.1", LATTICEAI_PORT: "4825", LATTICEAI_TUNNEL: "false" },
27
29
  stdio: "ignore",
28
30
  });
29
31
  }
package/docs/CHANGELOG.md CHANGED
@@ -4,9 +4,185 @@ The top entry is either the current unreleased main-branch work or the current
4
4
  release line. Older entries are historical and may describe behavior as it
5
5
  existed at that release.
6
6
 
7
- ## [Unreleased]
7
+ ## [9.2.0] - 2026-07-20
8
8
 
9
- No unreleased changes yet.
9
+ ### Added
10
+ - Added `latticeai/core/file_generation.py`, a model-agnostic file content
11
+ pipeline: extension-aware strict prompting with pinned first lines, payload
12
+ extraction from fences/`<think>` blocks/chat framing, per-type structural
13
+ validation, one corrective retry, and a deterministic repair fallback that
14
+ guarantees a structurally valid file from any loaded LLM.
15
+ - Added filename inference for chat file requests that name a type but no path
16
+ ("html 파일 만들어줘" → `generated_page.html`), keeping such requests on the
17
+ deterministic direct-write path instead of the model-driven agent loop.
18
+ - Added `generation` metadata (attempts, validation reasons, auto-repair flag)
19
+ to `/chat` direct file-action responses, and a user-facing notice when the
20
+ saved file was produced by auto-repair.
21
+ - Added `tests/unit/test_file_generation.py` covering extraction, validation,
22
+ repair, inference, prompting, and retry/repair orchestration (22 tests).
23
+
24
+ ### Changed
25
+ - Chat file-action routing counts explicit artifact types (html, 웹페이지,
26
+ webpage) as file words, so "html 페이지 만들어줘" creates a real file.
27
+ - Direct file generation clamps temperature to ≤0.3 and raises the token
28
+ budget to ≥4096 so generated documents complete.
29
+ - The agent executor prompt pins `write_file` content rules: complete raw
30
+ content, no Markdown fences, extension-valid documents.
31
+
32
+ ### Fixed
33
+ - Small local models (gemma/qwen class) no longer save chat wrappers, fenced
34
+ code blocks, reasoning traces, or truncated documents as file bytes.
35
+ - The agent JSON loop no longer aborts on the first malformed action reply:
36
+ `extract_action` strips `<think>` blocks and tolerates trailing commas, and
37
+ up to two corrective format reminders are fed back before halting.
38
+
39
+ ## [9.1.0] - 2026-07-11
40
+
41
+ ### Added
42
+ - Added required Telegram chat/callback allowlisting through
43
+ `LATTICEAI_TELEGRAM_ALLOWED_CHAT_IDS` and authenticated local API bridging
44
+ through `LATTICEAI_SERVER_SESSION_TOKEN`.
45
+ - Added signed, expiring invitation authorization, explicit legacy-global graph
46
+ read opt-in, and fail-closed regression coverage for broken or unknown
47
+ Knowledge Graph scope.
48
+ - Added optional permission-review deep links through
49
+ `LATTICEAI_PERMISSION_UI_URL` while keeping approval tokens out of outbound
50
+ notifications.
51
+ - Added Vitest coverage for API empty/result shapes, Brain proof state,
52
+ conversation sessions, shared primitives, and i18n, plus visual assertions
53
+ for unavailable core services.
54
+ - Added continuous vital rings, heartbeat echoes, neural sparks, body motion,
55
+ and Brain-to-graph particles whose speed and intensity reflect real listening,
56
+ recall, synthesis, and automation activity. Reduced-motion preferences still
57
+ disable nonessential animation.
58
+ - Added a living knowledge flow that shows chat, files, folders, notes, and web
59
+ pages entering the Brain, then renders a lightweight graph from actual
60
+ Knowledge Graph nodes and edges on the first screen.
61
+ - Added persistent conversation-to-knowledge traces, truthful ingestion
62
+ emergence counts and provenance, native desktop folder selection, and
63
+ evidence-linked Brain automation actions.
64
+ - Added a consent-preserving recipe lifecycle: create a reviewable disabled
65
+ draft, inspect its memory focus and evidence, then explicitly enable it.
66
+ - Added scoped MemoryService recall to workflow agents and researcher-first
67
+ execution for triggered and review-queue automation runs.
68
+ - Added a visible task-oriented desktop navigation, mobile bottom navigation,
69
+ accessible secondary menu, skip link, focus trap/restoration, keyboard-driven
70
+ tabs, and reduced-motion behavior for the React workspace.
71
+ - Added a dedicated human-first experience stylesheet that owns the product
72
+ shell, conversation canvas, shared content rhythm, responsive behavior, and
73
+ warm paper/ink/jade visual tokens.
74
+ - Added regression gates for model-request concurrency, workspace/identity
75
+ authorization, graph ID isolation, command sandbox escapes, SSRF and redirect
76
+ rebinding, approval ownership, release archive hygiene, browser-extension byte
77
+ limits/timeouts, OpenAPI drift, and disposable test harness state.
78
+ - Added a checked OpenAPI drift command and browser-extension test command to the
79
+ normal lint gate.
80
+
81
+ ### Changed
82
+ - Replaced ambient app-factory namespace assembly with typed config, security,
83
+ Brain, model, and router stages while retaining an explicit compatibility
84
+ surface.
85
+ - Replaced model-runtime dual globals with injected typed state and split chat
86
+ contracts, documents, history, and streaming into focused modules.
87
+ - Split Brain feature hooks, translation namespaces, and experience CSS by
88
+ product surface; frontend version copy now comes from package metadata.
89
+ - Consolidated shallow runtime pass-through modules, timestamps and run-status
90
+ constants, and moved setup/local-knowledge implementations behind package
91
+ owned modules with root compatibility shims.
92
+ - Archived code-review documents under `docs/reviews/`, removed obsolete local
93
+ VSIX artifacts, and documented Electron as an experimental compatibility shell.
94
+ - Compressed the empty Brain home into a single desktop/mobile viewport: the
95
+ living Brain, real graph, source dock, composer, primary grounded action, and
96
+ flow status remain visible without page scrolling. Conversation history,
97
+ deeper proof, and the complete automation action set now open in bounded
98
+ overlays instead of stacking below the fold.
99
+ - Rebuilt Brain Home around the visible source-to-memory-to-graph-to-automation
100
+ journey, while keeping the greeting, composer, suggested starts, recent
101
+ conversations, and optional deeper Brain proof.
102
+ - Renamed and regrouped the primary experience around Chat, Sources, Memory, and
103
+ Work. Memory now opens with search, basic Work leads with one goal composer,
104
+ and basic mode hides pipeline, agent-registry, runtime-metric, plugin, and
105
+ operator tabs until requested.
106
+ - Synced major tab choices to canonical hash routes so refresh, browser history,
107
+ and bookmarked Sources, Memory, Work, Model, and Settings subviews preserve
108
+ the user's place.
109
+ - Restyled shared panels, entity lists, empty states, statistics, onboarding,
110
+ source capture, and active messages to use solid surfaces, whitespace, and
111
+ separators instead of nested glass cards and dashboard grids.
112
+ - Brain Home now fetches a bounded graph preview so it can show real knowledge
113
+ relationships immediately; heavier proof and the full graph explorer remain
114
+ deferred until requested.
115
+ - Model generation, streaming, and document generation now use request-scoped
116
+ model snapshots without mutating the global selected model.
117
+ - New workspace-scoped graph nodes derive IDs from workspace identity, preventing
118
+ identical messages/files/concepts in separate workspaces from overwriting or
119
+ reassigning one another while preserving legacy unscoped reads.
120
+ - Workspace and identity transitions synchronously clear frontend query and
121
+ conversation state; the client-only egress toggle that claimed server-wide
122
+ enforcement was removed.
123
+ - Hook/model/network/registry/whole-graph portability and graph-curation operations now use administrator
124
+ boundaries, and chat/browser/upload/KG writes resolve workspace write access.
125
+ - MCP graph calls now enforce authenticated identity and workspace-scoped reads
126
+ and writes; local MCP environment values are never returned by the API, and
127
+ MCP/plugin tool dispatch cannot bypass the dedicated local-file approval flow.
128
+ - Memory, hybrid-search, and garden-note context assembly now use the active
129
+ workspace instead of blending content from every workspace the user can access.
130
+ - Document-generation RAG, answer traces, trace timeline events, and realtime
131
+ unscoped events now fail closed at the active workspace boundary.
132
+ - Long-lived realtime streams revalidate the session and workspace membership
133
+ before replay, every queued event, and each heartbeat, so revocation takes
134
+ effect without waiting for the SSE connection to reconnect.
135
+ - Realtime presence now validates workspace membership, prevents cross-user
136
+ client-id takeover/eviction, and assigns authenticated joins to an allowed
137
+ workspace instead of an unscoped global presence record.
138
+ - Local data directories and atomic JSON/session files now use private POSIX
139
+ permissions where supported.
140
+ - Docker packaging now uses a small build context, a non-root runtime user, and
141
+ a healthcheck; personal OpenClaw/bot bridge files are excluded from Git,
142
+ Docker, and every release archive while remaining available as ignored
143
+ machine-local files.
144
+
145
+ ### Fixed
146
+ - Closed every actionable item in the July 11 code review across fail-closed
147
+ security, typed runtime/model/chat ownership, honest frontend failures/tests,
148
+ and repository hygiene.
149
+ - Telegram now rejects unknown chats before registration; invitation gates no
150
+ longer trust a static cookie or built-in code, including SSO just-in-time
151
+ provisioning; and graph projection failures cannot expose cross-workspace
152
+ nodes.
153
+ - Agent and Computer Use history/run persistence now retains authenticated
154
+ user and workspace ownership, and recent model context is selected through
155
+ fail-closed storage scopes before prompt assembly.
156
+ - Desktop, knowledge, Obsidian, and network-status tools now use explicit
157
+ policy/capability/consent checks. Permission queues use atomic private writes,
158
+ notifications expose token hints only, and MCP paths are masked.
159
+ - Failed API results no longer become quiet healthy Brain state, proof is not
160
+ synthesized after failure, and action success callbacks run only on success.
161
+ - Fixed ingestion deltas that compared against truncated display lists instead
162
+ of complete graph/readiness baselines, and replaced simulated stage timers
163
+ with post-response memory and graph verification.
164
+ - Fixed global Brain recall pulses being ignored by Brain instances without a
165
+ local callback, relationship visuals inventing fallback endpoints, and SVG
166
+ gradient IDs colliding when multiple living Brains appear on one page.
167
+ - Fixed Brain automation hook/agent configuration mismatches, missing scoped
168
+ recall, trigger runs that skipped agent execution, and review-queue runs that
169
+ did not execute the workflow's agent node.
170
+ - Fixed local-folder graph nodes and Brain events trusting unvalidated or absent
171
+ workspace scope, losing scope on watcher restart, appearing in another
172
+ workspace's graph/search, or waking another workspace/owner's recipe. Legacy
173
+ personal nodes are reprojected without changing their IDs.
174
+ - Fixed recipe activation replacing reviewed user edits with the starter
175
+ definition, and stopped empty web captures from being presented as newly
176
+ remembered knowledge.
177
+ - Blocked permission request self-approval, stale disabled/deleted-account
178
+ sessions, agent approval forgery and cross-user resume, body identity spoofing,
179
+ command traversal/symlink/interpreter escapes, and authenticated scope lookup
180
+ fail-open behavior.
181
+ - Hardened URL ingestion against localhost/private/link-local/multicast/reserved
182
+ targets, mixed DNS answers, redirect-to-metadata attacks, environment proxies,
183
+ binary payloads, and unbounded response buffering.
184
+ - Isolated integration and OpenAPI generation from real `~/.ltcai` state and
185
+ made missing required npm tarballs a release-validation failure.
10
186
 
11
187
  ## [9.0.0] - 2026-07-08
12
188
 
@@ -1,11 +1,13 @@
1
1
  # Community And Plugins
2
2
 
3
- Current release: **9.0.0 — Code Review Closure & Runtime Cleanup**.
3
+ Current release: **9.2.0 — Model-Agnostic File Generation**.
4
4
 
5
5
  LatticeAI defines the path from a strong local-first framework (8.4.0
6
6
  action-aware baseline, 8.5.0 registry+DI hardening, 8.6.0 capture/navigation
7
7
  reliability, 8.7.0 runtime-state hygiene, 8.8.0 Brain Core extraction
8
- readiness, 8.9.0 scoped Tool API hardening, and 9.0.0 cleanup closure) to a product ecosystem. The
8
+ readiness, 8.9.0 scoped Tool API hardening, 9.0.0 cleanup closure, 9.1.0
9
+ fail-closed review completion, and 9.2.0 model-agnostic file generation) to a
10
+ product ecosystem. The
9
11
  immediate goal is small and practical: make it clear how
10
12
  contributors can extend the Brain without weakening local-first trust,
11
13
  workspace scoping, or release quality.
@@ -1,10 +1,10 @@
1
1
  # Lattice AI Development
2
2
 
3
- Current release: **9.0.0 — Code Review Closure & Runtime Cleanup**.
3
+ Current release: **9.2.0 — Model-Agnostic File Generation**.
4
4
 
5
5
  This document is for contributors working on the local-first Digital Brain
6
6
  codebase. Product positioning and quick start stay in `README.md`; release
7
- history is intentionally limited to 8.0.0-9.0.0 in `docs/CHANGELOG.md` and
7
+ history is intentionally limited to 8.0.0-9.2.0 in `docs/CHANGELOG.md` and
8
8
  `RELEASE.md`.
9
9
 
10
10
  ## Product Contract
@@ -51,12 +51,14 @@ API, UI, or release work, run:
51
51
  npm run check:python
52
52
  npm run lint
53
53
  npm run typecheck
54
+ npm run test:frontend
54
55
  npm run test:unit
55
56
  npm run docs:check-links
56
57
  ```
57
58
 
58
59
  `npm run lint` runs the Python Ruff baseline, frontend TypeScript lint gate,
59
- visual smoke syntax checks, and i18n literal checks.
60
+ visual smoke syntax checks, an exact generated-OpenAPI drift check, i18n literal
61
+ checks, and browser-extension syntax/behavior tests.
60
62
 
61
63
  Use these when the change touches the relevant surface:
62
64
 
@@ -64,10 +66,42 @@ Use these when the change touches the relevant surface:
64
66
  npm run test:integration
65
67
  npm run test:visual
66
68
  npm run desktop:tauri:check
69
+ npm run release:evidence
67
70
  npm run release:artifacts
68
71
  npm run release:validate
69
72
  ```
70
73
 
74
+ Run `npm run build:assets` before `npm run release:evidence`. The capture command
75
+ reads the current package version, writes only to `output/release/vX.Y.Z/`, and
76
+ requires Playwright Chromium plus `ffmpeg` for the checked-in GIF/WebM evidence.
77
+
78
+ `npm run test:integration` starts its own loopback server with disposable HOME,
79
+ data, Brain, agent, XDG, temp, SQLite, and vault paths. It refuses non-loopback
80
+ external base URLs so validation cannot mutate a developer's real local Brain.
81
+
82
+ Regenerate committed API artifacts with `npm run frontend:openapi`; CI and
83
+ `npm run lint` fail when either `frontend/openapi.json` or
84
+ `frontend/src/api/openapi.ts` differs from a fresh isolated export.
85
+
86
+ ## Frontend Experience Ownership
87
+
88
+ `frontend/src/styles/tokens.css` owns React color tokens and
89
+ `frontend/src/styles/experience.css` imports the focused shell, conversation,
90
+ graph, capture, and responsive layers under `frontend/src/styles/experience/`.
91
+ Keep ownership in the narrowest surface file; do not add another competing
92
+ shell or composer rule to `styles.css`.
93
+
94
+ Brain behavior belongs in the focused `useBrainChat`, `useBrainHistory`,
95
+ `useBrainIngestion`, and `useBrainProof` hooks. Translation namespaces live in
96
+ `frontend/src/i18n/`. Failed `ApiResult` values must remain unavailable/error
97
+ states rather than being normalized to healthy empty data, and affected paths
98
+ must have Vitest coverage.
99
+
100
+ Default mode should expose user tasks and outcomes. Runtime metrics, registry
101
+ identifiers, pipeline controls, and administrator tools belong in progressive
102
+ disclosure or advanced/admin mode. New navigation and tabs must preserve
103
+ keyboard access, visible focus, mobile safe areas, and reduced-motion behavior.
104
+
71
105
  ## Runtime Assembly
72
106
 
73
107
  `latticeai.app_factory` is the composition root. Keep it import-safe:
@@ -77,13 +111,18 @@ npm run release:validate
77
111
  - no filesystem writes at module import time;
78
112
  - no external network calls at module import time.
79
113
 
80
- Runtime assembly seams live under `latticeai.runtime`:
114
+ Runtime assembly seams live under `latticeai.runtime` as typed stages:
81
115
 
82
- - `config_runtime.py` derives app config values from `Config`;
116
+ - `config_runtime.py` derives immutable app config values from `Config`;
83
117
  - `security_runtime.py` applies trusted proxy/security-derived settings;
84
- - `brain_runtime.py` constructs Brain Core and conversation primitives.
85
- - model/runtime, ToolRegistry/MCP, router, static asset, and lifespan seams
86
- should continue moving out of monolithic app-factory helpers.
118
+ - `brain_runtime.py` constructs Brain Core and conversation primitives;
119
+ - model, platform, and router stages receive explicit dependencies and return
120
+ typed bundles rather than ambient `locals()` maps.
121
+
122
+ The module-level `server_app` compatibility surface is an explicit allowlist.
123
+ Model services use injected state, and HTTP exceptions belong at the API
124
+ boundary. Readiness tests should reject forbidden patterns instead of treating
125
+ symbol presence alone as architectural completion.
87
126
 
88
127
  Future extraction should continue with AgentRuntime, ToolRegistry, config,
89
128
  server decomposition, and Knowledge Graph stabilization in that order when
@@ -114,10 +153,10 @@ For user-facing, API, runtime, release, or packaging changes, check:
114
153
  Release/publish examples must use exact target-version filenames. Do not
115
154
  document wildcard artifact upload commands.
116
155
 
117
- For 9.0.0 release work, exact artifacts are:
156
+ For 9.2.0 release work, exact artifacts are:
118
157
 
119
- - `dist/ltcai-9.0.0-py3-none-any.whl`
120
- - `dist/ltcai-9.0.0.tar.gz`
121
- - `ltcai-9.0.0.tgz`
122
- - `dist/ltcai-9.0.0.vsix`
123
- - `src-tauri/target/release/bundle/dmg/Lattice AI_9.0.0_aarch64.dmg`
158
+ - `dist/ltcai-9.2.0-py3-none-any.whl`
159
+ - `dist/ltcai-9.2.0.tar.gz`
160
+ - `ltcai-9.2.0.tgz`
161
+ - `dist/ltcai-9.2.0.vsix`
162
+ - `src-tauri/target/release/bundle/dmg/Lattice AI_9.2.0_aarch64.dmg`
@@ -1,6 +1,6 @@
1
1
  # Legacy Compatibility Map
2
2
 
3
- Current target: **9.0.0 — Code Review Closure & Runtime Cleanup**.
3
+ Current target: **9.2.0 — Model-Agnostic File Generation**.
4
4
 
5
5
  Lattice AI is moving toward a smaller, modular architecture centered on
6
6
  `lattice_brain`, `latticeai.services`, `latticeai.api`, and `latticeai.runtime`.
@@ -56,14 +56,14 @@ standalone package:
56
56
  | `knowledge_graph.py` | `lattice_brain.graph` / `lattice_brain.knowledge` | Compatibility for older graph imports and historical tooling |
57
57
  | `knowledge_graph_api.py` | `latticeai.api.memory`, `latticeai.api.search`, graph-related API routers | Compatibility for older API import paths |
58
58
  | `kg_schema.py` | `lattice_brain` storage/schema modules | Compatibility for graph schema references |
59
- | `auto_setup.py` | setup/model recommendation services | Compatibility for zero-config setup probes and historical auto-setup commands |
59
+ | `auto_setup.py` | `latticeai.setup.auto_setup` | Thin compatibility shim for zero-config setup probes and historical commands |
60
60
  | `llm_router.py` | `latticeai.models.router` | Compatibility for older local model routing imports |
61
61
  | `ltcai_cli.py` | package console entrypoint (`ltcai`) | Compatibility for the installed CLI contract |
62
62
  | `mcp_registry.py` | `latticeai.core.mcp_registry` and service-backed registries | Compatibility for MCP/skills lookup entrypoints |
63
- | `local_knowledge_api.py` | `lattice_brain.ingestion`, workspace capture APIs | Compatibility for local folder/file watcher flows |
63
+ | `local_knowledge_api.py` | `latticeai.services.local_knowledge` | Thin compatibility shim for local folder/file watcher flows |
64
64
  | `p_reinforce.py` | gardener/maintenance service direction | Compatibility for existing Brain gardening runtime hooks |
65
65
  | `telegram_bot.py` | opt-in integration package or disabled-by-default connector | Compatibility only; Telegram must remain opt-in |
66
- | `setup_wizard.py` | setup and model recommendation services | Compatibility for first-run recommendation calls |
66
+ | `setup_wizard.py` | `latticeai.setup.wizard` | Thin compatibility shim for first-run recommendation calls |
67
67
  | `server.py` | lazy proxy to `latticeai.server_app` / `latticeai.app_factory` | Preserves historical `server.app` imports without import-time construction |
68
68
 
69
69
  ## Inner Shim Layers (removed in 8.8.0)
@@ -1,6 +1,6 @@
1
1
  # Lattice AI Onboarding
2
2
 
3
- Current release: **9.0.0 — Code Review Closure & Runtime Cleanup**.
3
+ Current release: **9.2.0 — Model-Agnostic File Generation**.
4
4
 
5
5
  The first-run goal is a five-minute path from "I opened the app" to "my Brain
6
6
  has a source, a question, and proof." This page is the product contract behind
@@ -21,8 +21,16 @@ read the docs first.
21
21
  ## Product Promises
22
22
 
23
23
  - The user starts in the Brain, not in an admin dashboard.
24
+ - The first screen asks what the user wants to do, then prioritizes one composer,
25
+ a few starters, and recent conversations over scores or system status.
26
+ - Chat, Sources, Memory, and Work stay one visible navigation action away on
27
+ desktop and mobile; models and administration do not compete with them.
28
+ - Memory starts with search. The connection map appears only when the user asks
29
+ to inspect relationships.
24
30
  - Empty states suggest one concrete next action without claiming proof that does
25
31
  not exist yet.
32
+ - Core-service failures show an unavailable/error state and recovery guidance;
33
+ they are never presented as an empty or healthy Brain.
26
34
  - Upload, note, browser, and message ingestion all converge through the unified
27
35
  ingestion pipeline when it is available.
28
36
  - Workspace-scoped content must not leak or overwrite another workspace's graph
@@ -32,7 +40,7 @@ read the docs first.
32
40
 
33
41
  ## Release Gate
34
42
 
35
- 9.0.0 treats onboarding as a release gate, not marketing copy. The current
43
+ 9.2.0 treats onboarding as a release gate, not marketing copy. The current
36
44
  machine-checkable product readiness report requires this five-minute contract,
37
45
  the Brain Home surface, setup helpers, graph ingestion tests, and exact release
38
46
  artifact documentation before the release can be called complete.
@@ -1,10 +1,10 @@
1
- # Lattice AI — Operations Guide
1
+ # Lattice AI — Operations Guide (v9.2.0)
2
2
 
3
3
  ## 1. 데이터 파일 위치
4
4
 
5
5
  | 파일 | 용도 |
6
6
  |------|------|
7
- | `~/.ltcai/users.json` | 사용자 계정 (bcrypt 해시 저장) |
7
+ | `~/.ltcai/users.json` | 사용자 계정 (scrypt 해시 저장) |
8
8
  | `~/.ltcai/history.json` | 대화 히스토리 |
9
9
  | `~/.ltcai/audit.json` | 감사 로그 (agent 실행, 사용자 변경 등) |
10
10
  | `~/.ltcai/brain/` | Knowledge Graph 노드 (Markdown) |
@@ -95,7 +95,7 @@ Cookie: session_id=<admin-session>
95
95
 
96
96
  ### 5.3 비밀번호 정책
97
97
  - 최소 8자
98
- - bcrypt (cost 12) 해시로 저장
98
+ - scrypt 해시로 저장
99
99
  - 평문은 저장되지 않음
100
100
 
101
101
  ## 6. 업그레이드 마이그레이션
@@ -120,11 +120,15 @@ pip install --upgrade ltcai
120
120
  공개 인터넷에 노출할 경우 반드시 확인:
121
121
 
122
122
  - [ ] `LATTICEAI_SECRET_KEY` 환경변수 설정 (32자 이상 랜덤 문자열)
123
+ - [ ] `LATTICEAI_MODE=public` 및 HTTPS에서 Secure cookie 동작 확인
124
+ - [ ] 초대 게이트 사용 시 랜덤 invite code 또는 생성된 설치별 secret 영구 보관
123
125
  - [ ] `LATTICEAI_ENABLE_GRAPH=false` (불필요 시 Graph 비활성화)
124
126
  - [ ] `HTTPS` 종단 프록시 설정 (nginx / Caddy)
125
127
  - [ ] `CSRF_TRUSTED_ORIGINS` 화이트리스트 설정
126
128
  - [ ] `ALLOWED_COMMANDS` 검토 — python3/node 등 불필요한 실행 도구 제거
127
- - [ ] 방화벽으로 8899 포트를 프록시만 접근 허용
129
+ - [ ] 방화벽으로 4825 포트를 프록시만 접근 허용
130
+ - [ ] Telegram 활성화 시 `LATTICEAI_TELEGRAM_ALLOWED_CHAT_IDS`와
131
+ `LATTICEAI_SERVER_SESSION_TOKEN` 설정
128
132
 
129
133
  ## 8. 사용자 데이터 격리
130
134
 
@@ -21,6 +21,10 @@ Already aligned:
21
21
  - First launch follows Login -> Environment Analysis -> Recommended Models ->
22
22
  Install & Load -> Brain.
23
23
  - The post-setup home is the living Brain plus conversation.
24
+ - The empty home presents the Brain, incoming sources, real relationship graph,
25
+ composer, and next grounded action in one viewport. Its life signal and motion
26
+ are driven by listening, recall, synthesis, and action state rather than being
27
+ a decorative loop; history and technical proof remain progressively disclosed.
24
28
  - The graph appears only after progressive depth: Brain -> Memories ->
25
29
  Knowledge -> Relationships -> Graph.
26
30
  - Brain Core, SQLite live local storage, optional PostgreSQL/pgvector
@@ -1,6 +1,6 @@
1
1
  # Lattice AI Trust Model
2
2
 
3
- Current release: **9.0.0 — Code Review Closure & Runtime Cleanup**.
3
+ Current release: **9.2.0 — Model-Agnostic File Generation**.
4
4
 
5
5
  Lattice AI is local-first, explicit about external communication, and honest
6
6
  when a capability is unavailable.
@@ -26,7 +26,8 @@ External communication requires configuration plus a user/admin action:
26
26
 
27
27
  - cloud model calls after keys are configured and a cloud model is selected;
28
28
  - model downloads from registries after install consent;
29
- - Telegram bridge after the integration is enabled;
29
+ - Telegram bridge after the integration is enabled, the chat is allowlisted,
30
+ and a dedicated server session bearer is configured;
30
31
  - Brain Network peer actions after pairing;
31
32
  - Docker/Postgres setup after opt-in scale configuration;
32
33
  - update checks only when enabled;
@@ -49,6 +50,8 @@ Lattice AI should fail closed or show an unavailable state for:
49
50
  - dry-run versus real execution;
50
51
  - no graph/context evidence available;
51
52
  - unavailable external integration;
53
+ - unknown or unreadable Knowledge Graph workspace scope;
54
+ - missing Telegram chat allowlist or dedicated server session token;
52
55
  - wrong archive passphrase;
53
56
  - archive tampering, unsupported archive versions, or path traversal.
54
57
 
@@ -1,6 +1,6 @@
1
1
  # Why Lattice AI Exists
2
2
 
3
- Current release: **9.0.0 — Code Review Closure & Runtime Cleanup**.
3
+ Current release: **9.2.0 — Model-Agnostic File Generation**.
4
4
 
5
5
  **Lattice AI is a local-first Digital Brain that keeps your knowledge durable
6
6
  across any AI model.**
@@ -28,15 +28,20 @@ Lattice AI keeps conversations, documents, memories, decisions, relationships,
28
28
  and source provenance in a private local Brain. Models can be local, cloud,
29
29
  current, or future. The Brain remains.
30
30
 
31
- The graph matters, but it is not the product identity. The product identity is a
32
- local-first Digital Brain: a place where the user can talk, add sources, watch
33
- memory grow, and inspect the Knowledge Graph when they need proof.
34
-
35
- In 9.0.0 the first screen is intentionally not a dashboard. The living Brain,
36
- conversation composer, evidence-backed Brain Brief, scoped memory isolation,
37
- and five-minute onboarding
38
- path appear together so the user immediately knows what matters, what to add,
39
- and why the answer is grounded in local memory.
31
+ The graph matters as visible proof, but a graph editor is not the product
32
+ identity. The product identity is a local-first Digital Brain: the user talks or
33
+ adds a source, watches it enter memory, sees the real relationships that emerge,
34
+ and uses those memories to drive reviewed automation.
35
+
36
+ The current main-branch experience is intentionally not a dashboard. The first
37
+ screen leads with a living knowledge journey around the conversation composer:
38
+ chat, file, folder, note, and web inputs flow into the Brain; a bounded real
39
+ graph makes new connections visible; and grounded next actions explain which
40
+ memory and evidence they use. Evidence-backed Brain Brief, deeper memory rings,
41
+ and runtime detail remain available without turning the first screen into an
42
+ operator console. Primary navigation follows human tasks — Chat, Sources,
43
+ Memory, and Work — while models, workspace controls, and administration stay
44
+ secondary.
40
45
 
41
46
  ## Practical Reasons To Use It
42
47
 
@@ -20,6 +20,28 @@ The engine version is exported as:
20
20
  WORKFLOW_ENGINE_VERSION = "2.2.0"
21
21
  ```
22
22
 
23
+ ## Memory-grounded Brain automation
24
+
25
+ Brain Home turns recalled knowledge into suggested actions and automation
26
+ recipes without silently enabling work. A recipe is first installed as a
27
+ disabled, reviewable workflow draft. The user can inspect its memory focus,
28
+ source, evidence, and agent roles, then explicitly enable the same workflow in
29
+ place; activation does not create a duplicate recipe or replace the user's
30
+ reviewed name, prompt, roles, or node edits.
31
+
32
+ When an enabled recipe receives a successful workspace-scoped Brain ingestion
33
+ event, the workflow runs a researcher-first agent chain:
34
+
35
+ ```text
36
+ Brain event -> researcher recall -> planner -> executor -> reviewer -> review queue
37
+ ```
38
+
39
+ The researcher receives scoped `MemoryService.recall` context. Trigger identity,
40
+ workspace, source provenance, and run ID remain attached through execution and
41
+ review. Chat, upload, local-folder, note, web, and compatible legacy ingestion
42
+ events are normalized; failed ingestion never triggers a recipe. Generated work
43
+ is staged for review rather than performing an unreviewed external action.
44
+
23
45
  ## v2.2 hardening
24
46
 
25
47
  - Agent node output is captured in workflow context and can flow into a later
package/docs/kg-schema.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Knowledge Graph Schema
2
2
 
3
- Current release: **9.0.0 — Code Review Closure & Runtime Cleanup**.
3
+ Current release: **9.2.0 — Model-Agnostic File Generation**.
4
4
 
5
5
  명세 출처: `lattice_ai_full_spec.pptx` 슬라이드 20·21·22
6
6
  구현: `kg_schema.py`
@@ -137,6 +137,10 @@ provenance(source_type, source_uri, content_hash, captured_at, modified_at,
137
137
  - 모든 콘텐츠 노드는 `SOURCE` 노드로 `INDEXED_FROM` 엣지를 가져 **출처를 항상 설명 가능**하다.
138
138
  - provenance 는 노드 `metadata.provenance` 에 임베드되며, 동시에 감사 가능한
139
139
  `ingestion_provenance` 테이블에 기록된다 (`KnowledgeGraphStore.get_provenance(node_id)`).
140
+ - 로컬 폴더 수집은 Computer/Drive/Folder/File/Chunk/Concept/semantic 노드 전체에
141
+ 동일한 `workspace_id`를 투영하고 신규 ID도 워크스페이스별로 분리한다. 기존
142
+ 범위 없는 로컬 폴더는 개인 Brain으로 재투영하되 기존 노드 ID는 보존하며,
143
+ 같은 폴더를 다른 워크스페이스로 조용히 재할당하지 않는다.
140
144
 
141
145
  구현: `lattice_brain/ingestion.py` (`IngestionPipeline`) 가 단일 진입점이며,
142
146
  파일/로컬폴더/URL/브라우저 탭/텍스트를 모두 이 형태로 정규화한다.
@@ -257,9 +261,16 @@ print(KGStoreV2(store.db_path).stats())
257
261
 
258
262
  ### v4 컬럼 (T3b/T3c)
259
263
 
260
- - `nodes_v2.workspace_id` — `NULL` = legacy-global (스코프 도입 이전 데이터)
264
+ - `nodes_v2.workspace_id` — `NULL` = legacy-global (스코프 도입 이전 데이터).
265
+ 9.1.0부터 일반 workspace 읽기에는 자동 포함하지 않으며
266
+ `include_legacy_global=True`를 명시한 호환 읽기에서만 포함
261
267
  - `nodes_v2.visibility` — 신규 스코프 쓰기는 `workspace`/`private`,
262
268
  스코프 없는 쓰기는 `legacy` (기존 공유 데이터를 몰래 private 으로
263
269
  만들지 않는다)
264
270
  - `nodes_v2.superseded_by` — 개정 체인 (`mark_superseded`)
265
271
  - `edge_occurrences` — 관계의 모든 관측 기록 (observed_at/weight/source)
272
+
273
+ workspace projection 조회가 실패하거나 node의 scope를 확인할 수 없으면 해당
274
+ node는 비공개로 취급해 빈 결과를 반환하거나 오류를 전파합니다. projection 장애를
275
+ legacy-global로 해석해 다른 workspace에 노출하는 fail-open 경로는 허용하지
276
+ 않습니다.