ltcai 4.3.3 → 4.4.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 (89) hide show
  1. package/README.md +21 -16
  2. package/docs/CHANGELOG.md +37 -0
  3. package/docs/V4_4_0_EXTRACTION_REPORT.md +239 -0
  4. package/lattice_brain/__init__.py +38 -23
  5. package/lattice_brain/_kg_common.py +11 -1
  6. package/lattice_brain/context.py +212 -2
  7. package/lattice_brain/conversations.py +234 -1
  8. package/lattice_brain/discovery.py +11 -1
  9. package/lattice_brain/documents.py +11 -1
  10. package/lattice_brain/graph/__init__.py +28 -0
  11. package/lattice_brain/graph/_kg_common.py +1123 -0
  12. package/lattice_brain/graph/curator.py +473 -0
  13. package/lattice_brain/graph/discovery.py +1455 -0
  14. package/lattice_brain/graph/documents.py +218 -0
  15. package/lattice_brain/graph/identity.py +175 -0
  16. package/lattice_brain/graph/ingest.py +644 -0
  17. package/lattice_brain/graph/network.py +205 -0
  18. package/lattice_brain/graph/projection.py +571 -0
  19. package/lattice_brain/graph/provenance.py +401 -0
  20. package/lattice_brain/graph/retrieval.py +1341 -0
  21. package/lattice_brain/graph/schema.py +640 -0
  22. package/lattice_brain/graph/store.py +237 -0
  23. package/lattice_brain/graph/write_master.py +225 -0
  24. package/lattice_brain/identity.py +11 -13
  25. package/lattice_brain/ingest.py +11 -1
  26. package/lattice_brain/ingestion.py +318 -0
  27. package/lattice_brain/memory.py +100 -1
  28. package/lattice_brain/network.py +11 -1
  29. package/lattice_brain/portability.py +431 -0
  30. package/lattice_brain/projection.py +11 -1
  31. package/lattice_brain/provenance.py +11 -1
  32. package/lattice_brain/retrieval.py +11 -1
  33. package/lattice_brain/runtime/__init__.py +32 -0
  34. package/lattice_brain/runtime/agent_runtime.py +569 -0
  35. package/lattice_brain/runtime/hooks.py +754 -0
  36. package/lattice_brain/runtime/multi_agent.py +795 -0
  37. package/lattice_brain/schema.py +11 -1
  38. package/lattice_brain/store.py +10 -2
  39. package/lattice_brain/workflow.py +461 -0
  40. package/lattice_brain/write_master.py +11 -1
  41. package/latticeai/__init__.py +1 -1
  42. package/latticeai/api/agents.py +2 -2
  43. package/latticeai/api/browser.py +1 -1
  44. package/latticeai/api/chat.py +1 -1
  45. package/latticeai/api/computer_use.py +1 -1
  46. package/latticeai/api/hooks.py +2 -2
  47. package/latticeai/api/mcp.py +1 -1
  48. package/latticeai/api/tools.py +1 -1
  49. package/latticeai/api/workflow_designer.py +2 -2
  50. package/latticeai/app_factory.py +4 -4
  51. package/latticeai/brain/__init__.py +24 -6
  52. package/latticeai/brain/_kg_common.py +11 -1117
  53. package/latticeai/brain/context.py +12 -208
  54. package/latticeai/brain/conversations.py +12 -231
  55. package/latticeai/brain/discovery.py +13 -1451
  56. package/latticeai/brain/documents.py +13 -214
  57. package/latticeai/brain/identity.py +11 -169
  58. package/latticeai/brain/ingest.py +13 -640
  59. package/latticeai/brain/memory.py +12 -97
  60. package/latticeai/brain/network.py +12 -200
  61. package/latticeai/brain/projection.py +13 -567
  62. package/latticeai/brain/provenance.py +13 -397
  63. package/latticeai/brain/retrieval.py +13 -1337
  64. package/latticeai/brain/schema.py +12 -635
  65. package/latticeai/brain/store.py +13 -233
  66. package/latticeai/brain/write_master.py +13 -221
  67. package/latticeai/core/agent.py +1 -1
  68. package/latticeai/core/agent_registry.py +2 -2
  69. package/latticeai/core/builtin_hooks.py +2 -2
  70. package/latticeai/core/graph_curator.py +6 -468
  71. package/latticeai/core/hooks.py +6 -749
  72. package/latticeai/core/marketplace.py +1 -1
  73. package/latticeai/core/multi_agent.py +6 -790
  74. package/latticeai/core/workflow_engine.py +6 -456
  75. package/latticeai/core/workspace_os.py +1 -1
  76. package/latticeai/services/agent_runtime.py +6 -564
  77. package/latticeai/services/ingestion.py +6 -313
  78. package/latticeai/services/kg_portability.py +6 -426
  79. package/latticeai/services/platform_runtime.py +3 -3
  80. package/latticeai/services/run_executor.py +1 -1
  81. package/latticeai/services/upload_service.py +1 -1
  82. package/p_reinforce.py +1 -1
  83. package/package.json +1 -1
  84. package/scripts/bump_version.py +1 -1
  85. package/scripts/wheel_smoke.py +7 -0
  86. package/src-tauri/Cargo.lock +1 -1
  87. package/src-tauri/Cargo.toml +1 -1
  88. package/src-tauri/tauri.conf.json +1 -1
  89. package/static/app/asset-manifest.json +1 -1
package/README.md CHANGED
@@ -7,12 +7,12 @@
7
7
  [![CI Status](https://github.com/TaeSooPark-PTS/LatticeAI/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/TaeSooPark-PTS/LatticeAI/actions/workflows/ci.yml)
8
8
  [![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)
9
9
 
10
- **Lattice AI v4.3.3 is a local-first Digital Brain desktop workspace.** It runs
10
+ **Lattice AI v4.4.0 is a local-first Digital Brain desktop workspace.** It runs
11
11
  as a Tauri desktop app with a localhost FastAPI sidecar, stores the user's brain
12
12
  locally by default, and presents the Knowledge Graph as the durable asset.
13
13
 
14
- This README describes the v4.3.3 release tree, which promotes the post-cleanup
15
- main branch after the v4.3.2 self-audit and independent dead-code/runtime audit.
14
+ This README describes the v4.4.0 release tree, which completes the physical
15
+ extraction of the Brain Core into the standalone `lattice_brain` package.
16
16
  External package registries are owner-published; the badges above link to
17
17
  package pages and may show the most recently published owner-controlled registry
18
18
  version, which can lag behind the GitHub Release.
@@ -40,7 +40,7 @@ version, which can lag behind the GitHub Release.
40
40
 
41
41
  ### Desktop Startup
42
42
 
43
- The v4.3.3 DMG build launches a visible Tauri app, starts the FastAPI sidecar on
43
+ The v4.4.0 DMG build launches a visible Tauri app, starts the FastAPI sidecar on
44
44
  localhost, and shuts that sidecar down on normal macOS quit.
45
45
 
46
46
  ![Desktop startup and local sidecar](output/audits/v4.3.2-rc/screenshots/13-desktop-sidecar-startup.png)
@@ -136,8 +136,11 @@ Archive evidence:
136
136
  - **Frontend**: React, TypeScript, Vite, TanStack Query, Zustand, Cytoscape.js,
137
137
  React Flow, Tailwind/shadcn-style primitives, generated OpenAPI client.
138
138
  - **Backend**: FastAPI on localhost is the source of truth for the UI.
139
- - **Brain Core**: independent Python package `lattice_brain`, imported by
140
- FastAPI, CLI, tests, and future tools.
139
+ - **Brain Core**: independent Python package `lattice_brain` (graph, memory,
140
+ context, conversations, ingestion, agent/hook runtime, workflow,
141
+ portability, storage) physically hosted in the package, imported by FastAPI,
142
+ CLI, tests, and future tools, and guaranteed by tests to never import
143
+ `latticeai`.
141
144
  - **Storage**: `StorageEngine` abstraction with SQLite default and optional
142
145
  PostgreSQL/pgvector scale mode.
143
146
  - **Portability**: encrypted `.latticebrain` archive plus backup/restore and
@@ -145,17 +148,17 @@ Archive evidence:
145
148
  - **Privacy**: local-first by default; cloud models, Telegram, Brain Network,
146
149
  Docker, model downloads, and update checks require explicit opt-in paths.
147
150
 
148
- See [ARCHITECTURE.md](ARCHITECTURE.md) for the detailed v4.3.3 architecture.
151
+ See [ARCHITECTURE.md](ARCHITECTURE.md) for the detailed v4.4.0 architecture.
149
152
 
150
153
  ## Installation And Release Artifacts
151
154
 
152
- Validated v4.3.3 artifacts are produced from the post-cleanup tree:
155
+ Validated v4.4.0 artifacts are produced from the extraction tree:
153
156
 
154
- - `dist/ltcai-4.3.3-py3-none-any.whl`
155
- - `dist/ltcai-4.3.3.tar.gz`
156
- - `ltcai-4.3.3.tgz`
157
- - `dist/ltcai-4.3.3.vsix`
158
- - `src-tauri/target/release/bundle/dmg/Lattice AI_4.3.3_aarch64.dmg`
157
+ - `dist/ltcai-4.4.0-py3-none-any.whl`
158
+ - `dist/ltcai-4.4.0.tar.gz`
159
+ - `ltcai-4.4.0.tgz`
160
+ - `dist/ltcai-4.4.0.vsix`
161
+ - `src-tauri/target/release/bundle/dmg/Lattice AI_4.4.0_aarch64.dmg`
159
162
 
160
163
  For a public release, attach only those exact artifacts to the GitHub Release.
161
164
  Package-registry publishing is reserved for the owner.
@@ -191,7 +194,7 @@ npm run test:unit
191
194
  LTCAI_TEST_BASE_URL=http://127.0.0.1:4932 npm run test:integration
192
195
  npm run test:visual
193
196
  npm run desktop:tauri:check
194
- node scripts/run_python.mjs scripts/wheel_smoke.py --wheel dist/ltcai-4.3.3-py3-none-any.whl
197
+ node scripts/run_python.mjs scripts/wheel_smoke.py --wheel dist/ltcai-4.4.0-py3-none-any.whl
195
198
  npm pack --dry-run
196
199
  ```
197
200
 
@@ -205,12 +208,13 @@ npm pack --dry-run
205
208
  - Model downloads and cloud model calls require explicit user action/consent.
206
209
  - Ask does not fabricate answers when no model is loaded.
207
210
  - Historical artifacts may remain in `dist/`; release uploads must use exact
208
- v4.3.3 filenames.
211
+ v4.4.0 filenames.
209
212
 
210
213
  ## Release History
211
214
 
212
215
  | Version | Theme |
213
216
  | --- | --- |
217
+ | 4.4.0 | Brain Engine Extraction: Brain Core physically moved into `lattice_brain` (graph/memory/context/conversation/ingestion/runtime/workflow/portability), latticeai paths reduced to compatibility shims, isolation tests guaranteeing no `latticeai` imports |
214
218
  | 4.3.3 | Dead-Code Cleanup Release: post-audit cleanup, architecture documentation correction, Vercel/static-docs readiness, README badge restoration, exact-current artifacts |
215
219
  | 4.3.2 | Product Polish & Graph UX Overhaul RC: evidence-based README, graph UX, structured product state, archive UX, desktop sidecar cleanup, publishing readiness |
216
220
  | 4.3.1 | End-User Audit Repair RC: desktop sidecar startup, npm clean install, default-off downloads, honest agent/workflow states |
@@ -223,10 +227,11 @@ npm pack --dry-run
223
227
 
224
228
  ## Current Documentation
225
229
 
226
- - [ARCHITECTURE.md](ARCHITECTURE.md) - v4.3.3 architecture.
230
+ - [ARCHITECTURE.md](ARCHITECTURE.md) - v4.4.0 architecture.
227
231
  - [FEATURE_STATUS.md](FEATURE_STATUS.md) - current feature status and historical
228
232
  status ledger.
229
233
  - [RELEASE_NOTES.md](RELEASE_NOTES.md) - current release notes index.
234
+ - [RELEASE_NOTES_v4.4.0.md](RELEASE_NOTES_v4.4.0.md) - v4.4.0 release notes.
230
235
  - [RELEASE_NOTES_v4.3.3.md](RELEASE_NOTES_v4.3.3.md) - v4.3.3 release notes.
231
236
  - [RELEASE.md](RELEASE.md) - release checklist and exact artifact guidance.
232
237
  - [SECURITY.md](SECURITY.md) - security posture.
package/docs/CHANGELOG.md CHANGED
@@ -3,6 +3,43 @@
3
3
  The top entry is the current release-preparation target. Older entries are
4
4
  historical and may describe behavior as it existed at that release.
5
5
 
6
+ ## [4.4.0] - 2026-06-13
7
+
8
+ > Brain Engine Extraction release: the Brain Core implementation physically
9
+ > moves into the standalone `lattice_brain` package.
10
+
11
+ ### Changed
12
+
13
+ - Physically moved the knowledge graph (schema, store, write/retrieval/
14
+ discovery/documents/ingest/projection/provenance mixins, identity, network,
15
+ curator) into `lattice_brain.graph`, and memory, context, conversations into
16
+ `lattice_brain` proper.
17
+ - Physically moved the unified ingestion pipeline, hooks registry, multi-agent
18
+ orchestrator, agent runtime, workflow engine, and KG portability service into
19
+ `lattice_brain.ingestion`, `lattice_brain.runtime`, `lattice_brain.workflow`,
20
+ and `lattice_brain.portability`.
21
+ - FastAPI app assembly, routers, and services now import `lattice_brain`
22
+ directly; `latticeai.brain.*` became deprecation shims and the moved
23
+ `latticeai.core.*`/`latticeai.services.*` paths became silent alias shims
24
+ with module identity preserved.
25
+ - Synchronized all version copies to `4.4.0` and updated architecture/release
26
+ documentation to describe the physical extraction.
27
+
28
+ ### Added
29
+
30
+ - `tests/unit/test_lattice_brain_isolation.py`: fails if `lattice_brain`
31
+ imports `latticeai` (import-hook enforced) and exercises the Brain Core
32
+ end-to-end (graph ingest/search, conversations, context, workflow, agent
33
+ runtime, encrypted archive round-trip) without FastAPI.
34
+ - `lattice_brain.graph` and `lattice_brain.runtime` subpackages, shipped in the
35
+ wheel and covered by the wheel smoke check.
36
+
37
+ ### Fixed
38
+
39
+ - The Brain Core boundary is no longer an import-path contract: importing
40
+ `lattice_brain` no longer pulls in `latticeai.brain`, and the package is
41
+ usable by CLI, tests, and future tools fully independently.
42
+
6
43
  ## [4.3.3] - 2026-06-13
7
44
 
8
45
  > Dead-Code Cleanup release after the independent audit cleanup on top of
@@ -0,0 +1,239 @@
1
+ # v4.4.0 Physical Extraction Report — `lattice_brain` Brain Engine
2
+
3
+ Date: 2026-06-13
4
+ Scope: complete physical extraction of the Brain Core implementation into the
5
+ standalone `lattice_brain` package. The release flow attaches only validated
6
+ v4.4.0 artifacts to GitHub; no external package registry publishing is part of
7
+ this release step.
8
+
9
+ ## 1. Problem Before v4.4.0
10
+
11
+ `lattice_brain` provided an import-path contract only. The graph, memory,
12
+ context, conversation, and ingestion implementations physically lived under
13
+ `latticeai/brain/` (and `latticeai/core/`, `latticeai/services/`) and were
14
+ re-exported through `lattice_brain.*`. Importing `lattice_brain.store`
15
+ actually executed `latticeai.brain.store`, so the Brain Core could not be
16
+ used, tested, or distributed independently of the FastAPI product package.
17
+
18
+ ## 2. Dependency Graph
19
+
20
+ ### Before (v4.3.3)
21
+
22
+ ```
23
+ lattice_brain.store/schema/retrieval/... (1-line re-exports)
24
+ │ imports
25
+
26
+ latticeai.brain.* (physical implementation)
27
+ │ imports
28
+ ├─ latticeai.services.ingestion (memory → IngestionItem)
29
+ │ └─ latticeai.core.hooks (dispatch_tool)
30
+ ├─ latticeai.core.graph_curator (projection, lazy)
31
+ └─ kg_schema (root shim → lattice_brain.schema → latticeai.brain.schema)
32
+ latticeai.services.agent_runtime → latticeai.core.multi_agent
33
+ latticeai.services.kg_portability → lattice_brain.archive/storage (already clean)
34
+ latticeai.core.workflow_engine (stdlib only, hosted in latticeai)
35
+ ```
36
+
37
+ Net effect: `import lattice_brain.store` pulled in `latticeai`.
38
+
39
+ ### After (v4.4.0)
40
+
41
+ ```
42
+ latticeai (FastAPI app, routers, services, product backend)
43
+ │ imports (one direction only)
44
+
45
+ lattice_brain (physical Brain Engine)
46
+ ├─ core, archive, embeddings, storage/ (already physical in v4.2+)
47
+ ├─ graph/ _kg_common, schema, store, write_master, retrieval, discovery,
48
+ │ documents, ingest, projection, provenance, identity, network,
49
+ │ curator
50
+ ├─ memory, context, conversations
51
+ ├─ ingestion (uses .runtime.hooks)
52
+ ├─ runtime/ hooks, multi_agent, agent_runtime
53
+ ├─ workflow
54
+ └─ portability (uses .archive/.storage/.graph.identity)
55
+ ```
56
+
57
+ `lattice_brain` has zero `latticeai` imports — enforced by an import-hook test.
58
+ External (third-party/optional) deps of the package: `cryptography`, `keyring`,
59
+ `httpx`, `psycopg` (opt-in), `sqlite-vec` (opt-in), document parsers
60
+ (`pdfplumber`, `python-docx`, `openpyxl`, `python-pptx`, `PIL`) — all already
61
+ declared in `pyproject.toml`.
62
+
63
+ ## 3. Files Moved (physical, via `git mv`, history preserved)
64
+
65
+ Knowledge graph → `lattice_brain/graph/`:
66
+
67
+ | From | To |
68
+ | --- | --- |
69
+ | `latticeai/brain/_kg_common.py` | `lattice_brain/graph/_kg_common.py` |
70
+ | `latticeai/brain/schema.py` | `lattice_brain/graph/schema.py` |
71
+ | `latticeai/brain/store.py` | `lattice_brain/graph/store.py` |
72
+ | `latticeai/brain/write_master.py` | `lattice_brain/graph/write_master.py` |
73
+ | `latticeai/brain/retrieval.py` | `lattice_brain/graph/retrieval.py` |
74
+ | `latticeai/brain/discovery.py` | `lattice_brain/graph/discovery.py` |
75
+ | `latticeai/brain/documents.py` | `lattice_brain/graph/documents.py` |
76
+ | `latticeai/brain/ingest.py` | `lattice_brain/graph/ingest.py` |
77
+ | `latticeai/brain/projection.py` | `lattice_brain/graph/projection.py` |
78
+ | `latticeai/brain/provenance.py` | `lattice_brain/graph/provenance.py` |
79
+ | `latticeai/brain/identity.py` | `lattice_brain/graph/identity.py` |
80
+ | `latticeai/brain/network.py` | `lattice_brain/graph/network.py` |
81
+ | `latticeai/core/graph_curator.py` | `lattice_brain/graph/curator.py` |
82
+
83
+ Memory / context / conversation:
84
+
85
+ | From | To |
86
+ | --- | --- |
87
+ | `latticeai/brain/memory.py` | `lattice_brain/memory.py` |
88
+ | `latticeai/brain/context.py` | `lattice_brain/context.py` |
89
+ | `latticeai/brain/conversations.py` | `lattice_brain/conversations.py` |
90
+
91
+ Ingestion / runtime / workflow / portability:
92
+
93
+ | From | To |
94
+ | --- | --- |
95
+ | `latticeai/services/ingestion.py` | `lattice_brain/ingestion.py` |
96
+ | `latticeai/core/hooks.py` | `lattice_brain/runtime/hooks.py` |
97
+ | `latticeai/core/multi_agent.py` | `lattice_brain/runtime/multi_agent.py` |
98
+ | `latticeai/services/agent_runtime.py` | `lattice_brain/runtime/agent_runtime.py` |
99
+ | `latticeai/core/workflow_engine.py` | `lattice_brain/workflow.py` |
100
+ | `latticeai/services/kg_portability.py` | `lattice_brain/portability.py` |
101
+
102
+ 19 files moved with history; 2 new subpackage `__init__.py` files
103
+ (`lattice_brain/graph/`, `lattice_brain/runtime/`).
104
+
105
+ Import edges rewritten inside moved code (the only source changes to the
106
+ implementations):
107
+
108
+ - `graph/_kg_common.py`: `latticeai.brain.schema` → `.schema`;
109
+ `lattice_brain.embeddings` → `..embeddings`
110
+ - `graph/projection.py`: lazy `latticeai.core.graph_curator` → `.curator`
111
+ - `graph/provenance.py`: lazy `kg_schema` → `.schema`
112
+ - `graph/network.py`: `lattice_brain.identity` → `.identity`
113
+ - `graph/store.py`: lazy `lattice_brain.storage` → `..storage`
114
+ - `memory.py`: `latticeai.services.ingestion` → `.ingestion`
115
+ - `ingestion.py`: `latticeai.core.hooks` → `.runtime.hooks`
116
+ - `runtime/agent_runtime.py`: `latticeai.core.multi_agent` → `.multi_agent`
117
+ - `portability.py`: absolute `lattice_brain.*` → relative; lazy identity →
118
+ `.graph.identity`
119
+ - `runtime/hooks.py`: three `binding` metadata strings updated to the new
120
+ physical paths
121
+
122
+ ## 4. Re-Export Modules Deleted / Replaced
123
+
124
+ Deleted (the old `lattice_brain → latticeai.brain` re-exports — the "fake
125
+ extraction" layer):
126
+ `lattice_brain/{_kg_common,schema,store,write_master,retrieval,discovery,documents,ingest,projection,provenance,network,identity}.py`
127
+
128
+ Each path was recreated as an **internal alias shim** (`sys.modules[__name__] =
129
+ lattice_brain.graph.<name>`), so old flat imports keep working with module
130
+ identity preserved (the shim and the physical module are the same object —
131
+ singletons, `isinstance`, and monkeypatching are unaffected). These alias the
132
+ package to itself; nothing re-exports `latticeai` anymore.
133
+
134
+ ## 5. Compatibility Shims Kept (latticeai side)
135
+
136
+ Deprecation shims (emit `DeprecationWarning`, alias the physical module):
137
+
138
+ - `latticeai/brain/__init__.py` (re-exports the public surface from
139
+ `lattice_brain`)
140
+ - `latticeai/brain/{store,schema,retrieval,discovery,documents,ingest,projection,provenance,write_master,network,identity,_kg_common,memory,context,conversations}.py`
141
+
142
+ Silent alias shims (still-supported old paths):
143
+
144
+ - `latticeai/core/hooks.py` → `lattice_brain.runtime.hooks`
145
+ - `latticeai/core/multi_agent.py` → `lattice_brain.runtime.multi_agent`
146
+ - `latticeai/core/workflow_engine.py` → `lattice_brain.workflow`
147
+ - `latticeai/core/graph_curator.py` → `lattice_brain.graph.curator`
148
+ - `latticeai/services/ingestion.py` → `lattice_brain.ingestion`
149
+ - `latticeai/services/agent_runtime.py` → `lattice_brain.runtime.agent_runtime`
150
+ - `latticeai/services/kg_portability.py` → `lattice_brain.portability`
151
+
152
+ Root-level shims (`kg_schema.py`, `knowledge_graph.py`, …) continue to work
153
+ unchanged through the flat `lattice_brain.*` paths.
154
+
155
+ ## 6. Consumers Updated to Import `lattice_brain` Directly
156
+
157
+ `latticeai/app_factory.py`, `latticeai/core/{agent,agent_registry,builtin_hooks}.py`,
158
+ `latticeai/api/{hooks,tools,computer_use,agents,browser,workflow_designer,chat,mcp}.py`,
159
+ `latticeai/services/{platform_runtime,run_executor,upload_service}.py`,
160
+ `p_reinforce.py`, `scripts/bump_version.py`, `scripts/wheel_smoke.py`, and all
161
+ test modules now use the physical `lattice_brain` paths. Zero non-shim
162
+ references to the old module locations remain.
163
+
164
+ ## 7. New Tests
165
+
166
+ `tests/unit/test_lattice_brain_isolation.py`:
167
+
168
+ 1. **`test_lattice_brain_never_imports_latticeai`** — subprocess installs a
169
+ `sys.meta_path` finder that raises on any `latticeai` import, imports every
170
+ `lattice_brain` module via `pkgutil.walk_packages`, resolves every lazy
171
+ facade export, and asserts `latticeai` never entered `sys.modules`. This
172
+ test fails if `lattice_brain` ever imports `latticeai`.
173
+ 2. **`test_lattice_brain_usable_in_isolation`** — with the same import block
174
+ active and FastAPI never started: `BrainCore` construction, ingestion
175
+ pipeline → graph write, graph search, conversation store append/count,
176
+ context assembly, workflow engine run, agent runtime/hooks availability,
177
+ and an encrypted `.latticebrain` archive create → inspect → verify
178
+ round-trip.
179
+
180
+ ## 8. Packaging / Version Changes
181
+
182
+ - `pyproject.toml`: packages now include `lattice_brain.graph` and
183
+ `lattice_brain.runtime`; version `4.4.0`.
184
+ - `scripts/wheel_smoke.py`: import matrix extended with the new subpackages
185
+ and modules.
186
+ - `scripts/bump_version.py`: `MULTI_AGENT_VERSION` target re-pointed to
187
+ `lattice_brain/runtime/multi_agent.py`.
188
+ - All 13 synchronized version copies bumped to `4.4.0` via
189
+ `scripts/bump_version.py` (Python, npm, lockfiles, VSIX, Tauri, asset
190
+ manifest, runtime constants).
191
+ - Docs updated: `ARCHITECTURE.md` (packaging note now describes the physical
192
+ layout and the isolation guarantee), `README.md` (Brain Core claim, history,
193
+ artifact names), `FEATURE_STATUS.md`, `SECURITY.md` (supported versions),
194
+ `RELEASE_NOTES.md`, `RELEASE_NOTES_v4.4.0.md`, `docs/CHANGELOG.md`,
195
+ `CHANGELOG.md` pointer.
196
+
197
+ ## 9. User Data and Behavior
198
+
199
+ No storage schema, migration, archive format, or API change. The SQLite
200
+ default engine, Postgres opt-in path, `.latticebrain` archive format, and
201
+ backup/restore flows are byte-identical code, relocated. Old pickles are not
202
+ used; module identity through shims keeps any dynamic lookups working.
203
+
204
+ ## 10. Validation Results
205
+
206
+ Environment note: final release validation ran locally on macOS with Python
207
+ 3.12.13 (`LTCAI_PYTHON=/tmp/ltcai-v440-py312/bin/python`), Node 26.0.0,
208
+ npm 11.12.1, Rust 1.96.0, Cargo 1.96.0, and Tauri CLI 2.0.0.
209
+
210
+ | Check | Result |
211
+ | --- | --- |
212
+ | Python compile (`compileall` over `lattice_brain`, `latticeai`, `tests`, `tools`, `scripts`, root modules) | PASS |
213
+ | `ruff check .` | PASS (no findings) |
214
+ | Unit tests (`pytest tests/unit`) | **604 passed** (includes the 2 new isolation tests) |
215
+ | Integration tests (`pytest tests/integration` against live uvicorn on localhost) | 9 passed, 1 skipped (live-Postgres test, opt-in by design) |
216
+ | `lattice_brain` isolation tests | PASS (both) |
217
+ | No `lattice_brain → latticeai` import test | PASS |
218
+ | Graph/search/ingestion tests (`test_kg_*`, `test_ingestion_pipeline`, `test_browser_ingestion`, …) | PASS (within unit suite) |
219
+ | Backup/restore + `.latticebrain` archive tests (`test_kg_portability`, archive round-trip in isolation test) | PASS |
220
+ | Frontend lint (`npm run lint`) | PASS |
221
+ | Frontend typecheck (`tsc --noEmit` + VS Code extension `tsc`) | PASS |
222
+ | Playwright visual tests (`npx playwright test`) | **12 passed** |
223
+ | Tauri check (`cargo check`) | PASS (existing transitive `block v0.1.6` future-incompat warning) |
224
+ | Tauri DMG build (`npm run release:artifacts`) | PASS (`Lattice AI_4.4.0_aarch64.dmg`) |
225
+ | Release artifact validation (`scripts/validate_release_artifacts.py 4.4.0 --require-vsix --require-tgz --require-dmg`) | PASS (warns about historical versions in `dist/`, as designed) |
226
+ | Wheel smoke | PASS (29 wheel modules import from the wheel; `/health` returns `4.4.0`) |
227
+ | `npm pack --dry-run` | PASS (315 files) |
228
+
229
+ ## 11. v4.4.0 Artifacts Built
230
+
231
+ - `dist/ltcai-4.4.0-py3-none-any.whl` (contains `lattice_brain/graph/*`,
232
+ `lattice_brain/runtime/*`; verified by wheel content check + smoke)
233
+ - `dist/ltcai-4.4.0.tar.gz`
234
+ - `ltcai-4.4.0.tgz` (npm pack)
235
+ - `dist/ltcai-4.4.0.vsix` (built via `scripts/build_vsix.mjs`)
236
+ - `src-tauri/target/release/bundle/dmg/Lattice AI_4.4.0_aarch64.dmg`
237
+
238
+ Per instructions: GitHub Release attachment uses only these exact validated
239
+ v4.4.0 artifacts. External package registries are not published.
@@ -1,7 +1,14 @@
1
1
  """lattice-brain — independent Brain Core package for Lattice AI.
2
2
 
3
- Heavy graph modules are lazy-loaded so storage and archive utilities remain
4
- usable without importing the FastAPI application or creating runtime globals.
3
+ Physically hosts the knowledge graph (``lattice_brain.graph``), memory,
4
+ context assembly, conversations, ingestion, agent/hook runtime
5
+ (``lattice_brain.runtime``), workflow engine, portability (backup/restore and
6
+ ``.latticebrain`` archives), and the storage abstraction.
7
+
8
+ The package never imports ``latticeai``; FastAPI and the desktop product
9
+ import this package, not the other way around. Heavy graph modules are
10
+ lazy-loaded so storage and archive utilities remain usable without creating
11
+ runtime globals.
5
12
  """
6
13
 
7
14
  from .archive import BrainArchivePaths, EncryptedBrainArchive
@@ -19,9 +26,10 @@ from .storage import (
19
26
  storage_from_env,
20
27
  )
21
28
 
22
- __version__ = "4.3.3"
29
+ __version__ = "4.4.0"
23
30
 
24
31
  __all__ = [
32
+ "AgentRuntime",
25
33
  "AssembledContext",
26
34
  "BrainArchivePaths",
27
35
  "BrainCore",
@@ -33,7 +41,11 @@ __all__ = [
33
41
  "DockerPostgresPlan",
34
42
  "DockerPostgresWizard",
35
43
  "EncryptedBrainArchive",
44
+ "IngestionItem",
45
+ "IngestionPipeline",
46
+ "KGPortabilityService",
36
47
  "KnowledgeGraphStore",
48
+ "MultiAgentOrchestrator",
37
49
  "PostgresConfig",
38
50
  "PostgresEngine",
39
51
  "SQLiteEngine",
@@ -41,30 +53,33 @@ __all__ = [
41
53
  "StorageCapabilities",
42
54
  "StorageEngine",
43
55
  "StorageUnavailable",
56
+ "WorkflowEngine",
44
57
  "storage_from_env",
45
58
  "__version__",
46
59
  ]
47
60
 
61
+ _LAZY = {
62
+ "AssembledContext": ("context", "AssembledContext"),
63
+ "ContextAssembler": ("context", "ContextAssembler"),
64
+ "ContextSection": ("context", "ContextSection"),
65
+ "ConversationStore": ("conversations", "ConversationStore"),
66
+ "BrainMemory": ("memory", "BrainMemory"),
67
+ "KnowledgeGraphStore": ("graph.store", "KnowledgeGraphStore"),
68
+ "IngestionItem": ("ingestion", "IngestionItem"),
69
+ "IngestionPipeline": ("ingestion", "IngestionPipeline"),
70
+ "KGPortabilityService": ("portability", "KGPortabilityService"),
71
+ "WorkflowEngine": ("workflow", "WorkflowEngine"),
72
+ "AgentRuntime": ("runtime.agent_runtime", "AgentRuntime"),
73
+ "MultiAgentOrchestrator": ("runtime.multi_agent", "MultiAgentOrchestrator"),
74
+ }
48
75
 
49
- def __getattr__(name: str):
50
- if name in {"AssembledContext", "ContextAssembler", "ContextSection"}:
51
- from .context import AssembledContext, ContextAssembler, ContextSection
52
-
53
- return {
54
- "AssembledContext": AssembledContext,
55
- "ContextAssembler": ContextAssembler,
56
- "ContextSection": ContextSection,
57
- }[name]
58
- if name == "ConversationStore":
59
- from .conversations import ConversationStore
60
76
 
61
- return ConversationStore
62
- if name == "BrainMemory":
63
- from .memory import BrainMemory
64
-
65
- return BrainMemory
66
- if name == "KnowledgeGraphStore":
67
- from .store import KnowledgeGraphStore
77
+ def __getattr__(name: str):
78
+ target = _LAZY.get(name)
79
+ if target is None:
80
+ raise AttributeError(name)
81
+ module_path, attr = target
82
+ import importlib
68
83
 
69
- return KnowledgeGraphStore
70
- raise AttributeError(name)
84
+ module = importlib.import_module(f".{module_path}", __name__)
85
+ return getattr(module, attr)
@@ -1 +1,11 @@
1
- from latticeai.brain._kg_common import * # noqa: F401,F403
1
+ """Compatibility shim: implementation moved to lattice_brain.graph._kg_common.
2
+
3
+ This module aliases itself to the physical module so identity, singletons,
4
+ and monkeypatching behave as if the old flat path were the real module.
5
+ """
6
+
7
+ import sys
8
+
9
+ from .graph import _kg_common as _impl
10
+
11
+ sys.modules[__name__] = _impl