ltcai 4.1.0 → 4.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.
- package/README.md +28 -24
- package/docs/CHANGELOG.md +42 -0
- package/docs/V4_2_BRAIN_CORE_ARCHITECTURE.md +97 -0
- package/docs/V4_2_STORAGE_MIGRATION_REPORT.md +91 -0
- package/docs/V4_2_VALIDATION_REPORT.md +89 -0
- package/docs/V4_DIGITAL_BRAIN_RECOVERY.md +31 -33
- package/frontend/openapi.json +247 -1
- package/frontend/src/api/client.ts +3 -0
- package/frontend/src/api/openapi.ts +284 -0
- package/frontend/src/pages/System.tsx +34 -0
- package/kg_schema.py +1 -1
- package/knowledge_graph.py +4 -4
- package/lattice_brain/__init__.py +70 -0
- package/lattice_brain/_kg_common.py +1 -0
- package/lattice_brain/archive.py +133 -0
- package/lattice_brain/context.py +3 -0
- package/lattice_brain/conversations.py +3 -0
- package/lattice_brain/core.py +82 -0
- package/lattice_brain/discovery.py +1 -0
- package/lattice_brain/documents.py +1 -0
- package/lattice_brain/embeddings.py +82 -0
- package/lattice_brain/identity.py +13 -0
- package/lattice_brain/ingest.py +1 -0
- package/lattice_brain/memory.py +3 -0
- package/lattice_brain/network.py +1 -0
- package/lattice_brain/projection.py +1 -0
- package/lattice_brain/provenance.py +1 -0
- package/lattice_brain/retrieval.py +1 -0
- package/lattice_brain/schema.py +1 -0
- package/lattice_brain/storage/__init__.py +22 -0
- package/lattice_brain/storage/base.py +72 -0
- package/lattice_brain/storage/docker.py +105 -0
- package/lattice_brain/storage/factory.py +31 -0
- package/lattice_brain/storage/migration.py +190 -0
- package/lattice_brain/storage/postgres.py +123 -0
- package/lattice_brain/storage/sqlite.py +128 -0
- package/lattice_brain/store.py +3 -0
- package/lattice_brain/write_master.py +1 -0
- package/latticeai/__init__.py +1 -1
- package/latticeai/api/portability.py +69 -0
- package/latticeai/app_factory.py +17 -10
- package/latticeai/brain/__init__.py +6 -6
- package/latticeai/brain/_kg_common.py +1 -1
- package/latticeai/brain/network.py +1 -1
- package/latticeai/brain/retrieval.py +15 -0
- package/latticeai/brain/store.py +22 -6
- package/latticeai/core/config.py +8 -0
- package/latticeai/core/marketplace.py +1 -1
- package/latticeai/core/multi_agent.py +1 -1
- package/latticeai/core/workspace_os.py +1 -1
- package/latticeai/services/kg_portability.py +82 -1
- package/package.json +2 -1
- package/scripts/bump_version.py +3 -0
- package/scripts/lint_frontend.mjs +5 -0
- package/scripts/migrate_brain_storage.py +53 -0
- package/scripts/wheel_smoke.py +3 -0
- package/src-tauri/Cargo.lock +1 -1
- package/src-tauri/Cargo.toml +1 -1
- package/src-tauri/tauri.conf.json +5 -2
- package/static/app/asset-manifest.json +5 -5
- package/static/app/assets/index-CDjiH_se.css +2 -0
- package/static/app/assets/{index-CJRAzNnf.js → index-C_HAkbAg.js} +3 -3
- package/static/app/assets/index-C_HAkbAg.js.map +1 -0
- package/static/app/index.html +2 -2
- package/static/app/assets/index-CJRAzNnf.js.map +0 -1
- package/static/app/assets/index-CSwBBgf4.css +0 -2
package/README.md
CHANGED
|
@@ -203,34 +203,32 @@ npm run dev
|
|
|
203
203
|
|
|
204
204
|
## Latest Release
|
|
205
205
|
|
|
206
|
-
### v4.
|
|
207
|
-
|
|
208
|
-
- **
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
- **
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
- **
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
- **
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
See [RELEASE_NOTES_v4.1.0.md](RELEASE_NOTES_v4.1.0.md),
|
|
206
|
+
### v4.2.0 — Brain Core & Storage Rebuild
|
|
207
|
+
|
|
208
|
+
- **Independent Brain Core package** — `lattice_brain` exposes the Knowledge
|
|
209
|
+
Graph, durable conversations, memory/context, signed exchange, archives, and
|
|
210
|
+
storage tools for FastAPI, CLI, tests, and future tools.
|
|
211
|
+
- **Pluggable storage layer** — `StorageEngine`, `SQLiteEngine`, and
|
|
212
|
+
`PostgresEngine` give the backend an explicit storage boundary. SQLite stays
|
|
213
|
+
the default.
|
|
214
|
+
- **Honest vector search** — sqlite-vec is detected when available; otherwise
|
|
215
|
+
the real local hash-embedding cosine path remains active and reported.
|
|
216
|
+
- **Postgres scale mode** — pgvector setup and SQLite-to-Postgres migration are
|
|
217
|
+
opt-in. Live Docker validation covers migration integrity, idempotence, and
|
|
218
|
+
pgvector distance search. Explicit Postgres selection fails loudly when
|
|
219
|
+
DSN/dependencies are missing; it never hides failure with a SQLite fallback.
|
|
220
|
+
- **Consent-gated Docker setup** — Docker Compose setup is generated locally
|
|
221
|
+
and only starts Docker after explicit user consent.
|
|
222
|
+
- **Encrypted `.latticebrain` archives** — local encrypted backup/restore over
|
|
223
|
+
the brain DB and blobs, with bad passphrases failing closed.
|
|
224
|
+
|
|
225
|
+
See [RELEASE_NOTES_v4.2.0.md](RELEASE_NOTES_v4.2.0.md),
|
|
228
226
|
[docs/kg-schema.md](docs/kg-schema.md),
|
|
229
227
|
[FEATURE_STATUS.md](FEATURE_STATUS.md).
|
|
230
228
|
|
|
231
229
|
## How it works — every source converges into the graph
|
|
232
230
|
|
|
233
|
-
As of v4.
|
|
231
|
+
As of v4.2.0, data sources flow through the brain ingestion pipeline into
|
|
234
232
|
the Knowledge Graph — no source bypasses it, none becomes an isolated silo:
|
|
235
233
|
|
|
236
234
|
```text
|
|
@@ -246,7 +244,8 @@ source (file · folder · PDF · web URL · browser tab · text)
|
|
|
246
244
|
- **The graph is the asset.** Memory, search, and agents are views over it; models
|
|
247
245
|
read it. Swap a model and your knowledge is unchanged.
|
|
248
246
|
- **Portable, no cloud.** Export/import the graph as JSON, or take a full local
|
|
249
|
-
binary backup (DB + blobs)
|
|
247
|
+
binary backup (DB + blobs), encrypted `.latticebrain` archive, or explicit
|
|
248
|
+
SQLite-to-Postgres migration plan and restore it.
|
|
250
249
|
- **Local-first protects the graph.** It lives in local SQLite on your machine.
|
|
251
250
|
|
|
252
251
|
For the deeper design, see [ARCHITECTURE.md](ARCHITECTURE.md) and
|
|
@@ -264,6 +263,9 @@ For the deeper design, see [ARCHITECTURE.md](ARCHITECTURE.md) and
|
|
|
264
263
|
|
|
265
264
|
- [ARCHITECTURE.md](ARCHITECTURE.md) — workspace, graph, pipeline, and model overview
|
|
266
265
|
- [docs/architecture.md](docs/architecture.md) — full architecture reference
|
|
266
|
+
- [docs/V4_2_BRAIN_CORE_ARCHITECTURE.md](docs/V4_2_BRAIN_CORE_ARCHITECTURE.md) — v4.2.0 Brain Core package and storage architecture
|
|
267
|
+
- [docs/V4_2_STORAGE_MIGRATION_REPORT.md](docs/V4_2_STORAGE_MIGRATION_REPORT.md) — v4.2.0 storage migration and archive report
|
|
268
|
+
- [docs/V4_2_VALIDATION_REPORT.md](docs/V4_2_VALIDATION_REPORT.md) — v4.2.0 validation report
|
|
267
269
|
- [docs/V4_1_FRONTEND_ARCHITECTURE_REVIEW.md](docs/V4_1_FRONTEND_ARCHITECTURE_REVIEW.md) — v4.1.0 frontend and desktop architecture review
|
|
268
270
|
- [docs/V4_1_FRONTEND_MIGRATION_REPORT.md](docs/V4_1_FRONTEND_MIGRATION_REPORT.md) — v4.1.0 capability migration report
|
|
269
271
|
- [docs/V4_1_VALIDATION_REPORT.md](docs/V4_1_VALIDATION_REPORT.md) — v4.1.0 validation report
|
|
@@ -285,6 +287,7 @@ For the deeper design, see [ARCHITECTURE.md](ARCHITECTURE.md) and
|
|
|
285
287
|
### Releases
|
|
286
288
|
|
|
287
289
|
- [RELEASE_NOTES.md](RELEASE_NOTES.md) — current release notes
|
|
290
|
+
- [RELEASE_NOTES_v4.2.0.md](RELEASE_NOTES_v4.2.0.md)
|
|
288
291
|
- [RELEASE_NOTES_v4.1.0.md](RELEASE_NOTES_v4.1.0.md)
|
|
289
292
|
- [RELEASE_NOTES_v4.0.1.md](RELEASE_NOTES_v4.0.1.md)
|
|
290
293
|
- [RELEASE_NOTES_v4.0.0.md](RELEASE_NOTES_v4.0.0.md)
|
|
@@ -298,6 +301,7 @@ For the deeper design, see [ARCHITECTURE.md](ARCHITECTURE.md) and
|
|
|
298
301
|
|
|
299
302
|
| Version | Theme |
|
|
300
303
|
| --- | --- |
|
|
304
|
+
| **4.2.0** | Brain Core & Storage Rebuild — independent `lattice_brain` package, pluggable storage layer, sqlite-vec/pgvector capability reporting, explicit Postgres migration, consent-gated Docker setup, encrypted `.latticebrain` archives |
|
|
301
305
|
| **4.1.0** | Frontend & Desktop Rebuild RC — React/Vite/OpenAPI desktop SPA, Tauri 2.0 primary shell, graph-first navigation, and legacy static frontend removal |
|
|
302
306
|
| **4.0.1** | Digital Brain Platform maintenance — closes post-tag v4 gaps with durable async runs, stable identity/workspace state, full `/app` parity, and legacy UI retirement |
|
|
303
307
|
| **4.0.0** | Digital Brain Platform — decomposed brain store, v2 write-mastered Knowledge Graph, durable memory/context, real workflow/agent foundations, signed brain exchange |
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,47 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [4.2.0] - 2026-06-12
|
|
4
|
+
|
|
5
|
+
> Brain Core & Storage Rebuild release. The backend Digital Brain boundary is
|
|
6
|
+
> available through the independent `lattice_brain` package, while the v4.1.0
|
|
7
|
+
> frontend, FastAPI contracts, and SQLite user data remain compatible.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- `lattice_brain` import package with `BrainCore`, Knowledge Graph,
|
|
12
|
+
conversation, memory/context, identity/network, archive, and storage facades.
|
|
13
|
+
- Pluggable storage layer: `StorageEngine`, `SQLiteEngine`, `PostgresEngine`,
|
|
14
|
+
`DockerPostgresWizard`, and `SQLiteToPostgresMigrator`.
|
|
15
|
+
- sqlite-vec capability detection with honest `bruteforce-cosine` local vector
|
|
16
|
+
search fallback.
|
|
17
|
+
- Opt-in Postgres/pgvector scale setup and non-destructive SQLite-to-Postgres
|
|
18
|
+
migration planning/copy tooling.
|
|
19
|
+
- Live Docker-backed pgvector migration validation, including rowid-less FTS5
|
|
20
|
+
shadow tables, row-count integrity, idempotent reruns, and fail-closed
|
|
21
|
+
Postgres behavior.
|
|
22
|
+
- Encrypted `.latticebrain` archive create/restore support for the SQLite brain
|
|
23
|
+
database and blob directory.
|
|
24
|
+
- FastAPI routes for storage status, consent-gated Docker setup,
|
|
25
|
+
SQLite-to-Postgres migration, and encrypted archive create/restore.
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
- FastAPI constructs the graph/conversation runtime through
|
|
30
|
+
`lattice_brain.BrainCore`; root and `latticeai.brain.*` imports remain
|
|
31
|
+
compatibility shims.
|
|
32
|
+
- OpenAPI client regenerated with 313 paths.
|
|
33
|
+
- System settings exposes API-backed storage status, Docker setup consent, and
|
|
34
|
+
migration planning controls.
|
|
35
|
+
- Synchronized package/runtime versions to `4.2.0`, including Tauri config and
|
|
36
|
+
`lattice_brain.__version__`.
|
|
37
|
+
|
|
38
|
+
### Expected Artifacts
|
|
39
|
+
|
|
40
|
+
- `dist/ltcai-4.2.0-py3-none-any.whl`
|
|
41
|
+
- `dist/ltcai-4.2.0.tar.gz`
|
|
42
|
+
- `dist/ltcai-4.2.0.vsix`
|
|
43
|
+
- `ltcai-4.2.0.tgz`
|
|
44
|
+
|
|
3
45
|
## [4.1.0] - 2026-06-12
|
|
4
46
|
|
|
5
47
|
> Frontend & Desktop Rebuild release candidate. The existing FastAPI backend,
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Lattice AI v4.2.0 — Brain Core Architecture
|
|
2
|
+
|
|
3
|
+
Status: released validation complete
|
|
4
|
+
|
|
5
|
+
v4.2.0 extracts the Digital Brain backend boundary into the importable
|
|
6
|
+
`lattice_brain` package while preserving the existing FastAPI contracts and the
|
|
7
|
+
v4.1.0 user data layout. FastAPI, CLI, tests, and future tools can now import
|
|
8
|
+
Brain Core directly instead of reaching through root compatibility modules.
|
|
9
|
+
|
|
10
|
+
## Package Boundary
|
|
11
|
+
|
|
12
|
+
- `lattice_brain` is the independent Brain Core package namespace.
|
|
13
|
+
- `latticeai.brain` remains as a compatibility namespace for existing callers.
|
|
14
|
+
- Root modules such as `knowledge_graph.py` and `kg_schema.py` remain
|
|
15
|
+
compatibility shims.
|
|
16
|
+
- FastAPI now constructs the graph and durable conversation store through
|
|
17
|
+
`lattice_brain.BrainCore`.
|
|
18
|
+
|
|
19
|
+
## Brain Core Surfaces
|
|
20
|
+
|
|
21
|
+
The package exposes the implemented v4 brain modules:
|
|
22
|
+
|
|
23
|
+
- Knowledge system: `KnowledgeGraphStore`
|
|
24
|
+
- Memory system: `BrainMemory`
|
|
25
|
+
- Context assembler: `ContextAssembler`
|
|
26
|
+
- Durable conversations: `ConversationStore`
|
|
27
|
+
- Device identity and signed exchange helpers
|
|
28
|
+
- Brain Network compatibility exports
|
|
29
|
+
- Encrypted `.latticebrain` archives
|
|
30
|
+
- Storage abstraction and migration tools
|
|
31
|
+
|
|
32
|
+
The frontend still talks only to FastAPI localhost APIs. No frontend code calls
|
|
33
|
+
Python directly.
|
|
34
|
+
|
|
35
|
+
## Storage Layer
|
|
36
|
+
|
|
37
|
+
`lattice_brain.storage` introduces:
|
|
38
|
+
|
|
39
|
+
- `StorageEngine` ABC
|
|
40
|
+
- `SQLiteEngine` default engine
|
|
41
|
+
- `PostgresEngine` opt-in engine with pgvector extension setup
|
|
42
|
+
- `DockerPostgresWizard` explicit-consent local Docker setup
|
|
43
|
+
- `SQLiteToPostgresMigrator` idempotent migration planner/runner, including
|
|
44
|
+
rowid-less FTS5 shadow table support through declared primary keys
|
|
45
|
+
|
|
46
|
+
SQLite remains the default. Postgres is never required. If
|
|
47
|
+
`LATTICEAI_STORAGE_ENGINE=postgres` is selected without a DSN or optional
|
|
48
|
+
dependency support, startup fails honestly instead of silently falling back to
|
|
49
|
+
SQLite.
|
|
50
|
+
|
|
51
|
+
## Vector Search
|
|
52
|
+
|
|
53
|
+
SQLite vector search remains real and local:
|
|
54
|
+
|
|
55
|
+
- Existing vector rows stay in `vector_embeddings`.
|
|
56
|
+
- The active fallback is deterministic local hash embeddings with brute-force
|
|
57
|
+
cosine scoring.
|
|
58
|
+
- `sqlite-vec` is detected and loaded when available.
|
|
59
|
+
- Capability reports distinguish `sqlite-vec` from `bruteforce-cosine`; the
|
|
60
|
+
fallback is reported honestly and is still a real search path.
|
|
61
|
+
|
|
62
|
+
Postgres scale mode initializes a pgvector-backed `brain_vectors` table when
|
|
63
|
+
the `vector` extension is available.
|
|
64
|
+
|
|
65
|
+
## Archive Model
|
|
66
|
+
|
|
67
|
+
v4.2.0 adds encrypted `.latticebrain` archives:
|
|
68
|
+
|
|
69
|
+
- AES-256-GCM payload encryption
|
|
70
|
+
- PBKDF2-HMAC-SHA256 key derivation
|
|
71
|
+
- Encrypted SQLite database and blob payload
|
|
72
|
+
- Restore replaces the target DB/WAL/SHM safely and restores blobs
|
|
73
|
+
- Wrong passphrase or tampered data fails closed
|
|
74
|
+
|
|
75
|
+
The existing JSON export/import and ZIP backup/restore paths remain compatible.
|
|
76
|
+
|
|
77
|
+
## FastAPI APIs
|
|
78
|
+
|
|
79
|
+
New localhost APIs:
|
|
80
|
+
|
|
81
|
+
- `GET /api/brain/storage`
|
|
82
|
+
- `POST /api/brain/storage/postgres/docker`
|
|
83
|
+
- `POST /api/brain/storage/migrate-postgres`
|
|
84
|
+
- `POST /api/knowledge-graph/archive`
|
|
85
|
+
- `POST /api/knowledge-graph/archive/restore`
|
|
86
|
+
|
|
87
|
+
All mutating operations require admin authorization. Docker starts only when the
|
|
88
|
+
request explicitly carries consent.
|
|
89
|
+
|
|
90
|
+
## Compatibility
|
|
91
|
+
|
|
92
|
+
- Existing v4.1.0 SQLite data remains in `knowledge_graph.sqlite`.
|
|
93
|
+
- Existing `knowledge_graph.py`, `kg_schema.py`, and `latticeai.brain.*`
|
|
94
|
+
imports continue to work.
|
|
95
|
+
- Existing FastAPI routes remain available.
|
|
96
|
+
- Existing release artifacts still build.
|
|
97
|
+
- No data-loss migration is performed automatically.
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Lattice AI v4.2.0 — Storage Migration Report
|
|
2
|
+
|
|
3
|
+
Status: released validation complete
|
|
4
|
+
|
|
5
|
+
v4.2.0 adds a pluggable storage layer without changing the default local-first
|
|
6
|
+
runtime. Existing users continue on SQLite. Postgres is an explicit opt-in
|
|
7
|
+
scale target, not a required dependency and not an automatic fallback.
|
|
8
|
+
|
|
9
|
+
## Existing Data
|
|
10
|
+
|
|
11
|
+
- Existing v4.1.0 data remains in `~/.ltcai/knowledge_graph.sqlite`.
|
|
12
|
+
- Blob payloads remain in `~/.ltcai/knowledge_graph_blobs/`.
|
|
13
|
+
- Durable conversations continue to share the same SQLite DB family.
|
|
14
|
+
- No startup migration rewrites user data for v4.2.0.
|
|
15
|
+
|
|
16
|
+
## SQLite Engine
|
|
17
|
+
|
|
18
|
+
`SQLiteEngine` owns SQLite connection setup:
|
|
19
|
+
|
|
20
|
+
- WAL mode
|
|
21
|
+
- foreign keys enabled
|
|
22
|
+
- local path creation
|
|
23
|
+
- backup and restore helpers
|
|
24
|
+
- sqlite-vec loading attempt when installed
|
|
25
|
+
- honest capability report when sqlite-vec is unavailable
|
|
26
|
+
|
|
27
|
+
The current graph store continues to use SQLite-specific SQL and is therefore
|
|
28
|
+
wired only to `SQLiteEngine` for the active FastAPI runtime.
|
|
29
|
+
|
|
30
|
+
## Postgres Engine
|
|
31
|
+
|
|
32
|
+
`PostgresEngine` is opt-in and fail-closed:
|
|
33
|
+
|
|
34
|
+
- Requires `LATTICEAI_POSTGRES_DSN` when explicitly selected.
|
|
35
|
+
- Requires optional `psycopg` support.
|
|
36
|
+
- Creates `lattice_brain` schema by default.
|
|
37
|
+
- Runs `CREATE EXTENSION IF NOT EXISTS vector`.
|
|
38
|
+
- Creates a pgvector-backed `brain_vectors` table.
|
|
39
|
+
|
|
40
|
+
If Postgres is selected but unavailable, Lattice AI reports the error. It does
|
|
41
|
+
not hide the failure by falling back to SQLite.
|
|
42
|
+
|
|
43
|
+
## Docker Setup
|
|
44
|
+
|
|
45
|
+
`DockerPostgresWizard` writes a local Docker Compose file for
|
|
46
|
+
`pgvector/pgvector:pg16`. It never runs Docker unless the caller explicitly
|
|
47
|
+
passes consent.
|
|
48
|
+
|
|
49
|
+
API behavior:
|
|
50
|
+
|
|
51
|
+
- `consent=false`: writes the compose file and returns `consent_required`.
|
|
52
|
+
- `dry_run=true`: returns the exact Docker command without starting anything.
|
|
53
|
+
- `consent=true` and `dry_run=false`: runs `docker compose up -d postgres`.
|
|
54
|
+
|
|
55
|
+
## SQLite to Postgres Migration
|
|
56
|
+
|
|
57
|
+
`SQLiteToPostgresMigrator` plans and copies all user tables from a SQLite brain
|
|
58
|
+
database into Postgres:
|
|
59
|
+
|
|
60
|
+
- Introspects non-internal SQLite tables.
|
|
61
|
+
- Preserves every row.
|
|
62
|
+
- Uses table `id` as the idempotence key when present.
|
|
63
|
+
- Uses declared primary keys, including composite keys on rowid-less FTS5 shadow
|
|
64
|
+
tables.
|
|
65
|
+
- Uses preserved `__source_rowid` when no declared key exists and SQLite rowid
|
|
66
|
+
is available.
|
|
67
|
+
- Upserts rows on repeated runs.
|
|
68
|
+
- Leaves the source SQLite database untouched.
|
|
69
|
+
|
|
70
|
+
The API defaults to dry-run migration planning. Actual copy requires an
|
|
71
|
+
explicit DSN and `dry_run=false`.
|
|
72
|
+
|
|
73
|
+
Live v4.2.0 validation used explicit Docker consent to start
|
|
74
|
+
`pgvector/pgvector:pg16`, copy a seeded v4 SQLite brain database into
|
|
75
|
+
Postgres, verify source and destination row counts, rerun the migration
|
|
76
|
+
idempotently, query pgvector distance ordering, and tear down the test Compose
|
|
77
|
+
stack with volumes.
|
|
78
|
+
|
|
79
|
+
## Encrypted Archives
|
|
80
|
+
|
|
81
|
+
`.latticebrain` archive support was added for local encrypted backup/restore:
|
|
82
|
+
|
|
83
|
+
- Database and blobs are zipped locally.
|
|
84
|
+
- Payload is encrypted with AES-256-GCM.
|
|
85
|
+
- Keys derive from the user passphrase via PBKDF2-HMAC-SHA256.
|
|
86
|
+
- Restore rejects bad passphrases or tampered payloads.
|
|
87
|
+
|
|
88
|
+
## Compatibility Result
|
|
89
|
+
|
|
90
|
+
No v4.1.0 capability is removed. SQLite remains the default and does not depend
|
|
91
|
+
on Docker, Postgres, pgvector, or network access.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Lattice AI v4.2.0 — Validation Report
|
|
2
|
+
|
|
3
|
+
Date: 2026-06-12
|
|
4
|
+
Commit under validation: v4.2.0 release commit on `main` after `v4.1.0`
|
|
5
|
+
|
|
6
|
+
## Result
|
|
7
|
+
|
|
8
|
+
v4.2.0 validation passed for the implemented Brain Core package, storage
|
|
9
|
+
abstraction, SQLite default runtime, encrypted archives, generated OpenAPI
|
|
10
|
+
client, frontend/system controls, Docker-backed Postgres/pgvector migration,
|
|
11
|
+
desktop check, and release artifacts.
|
|
12
|
+
|
|
13
|
+
## Commands
|
|
14
|
+
|
|
15
|
+
| Check | Command | Result |
|
|
16
|
+
| --- | --- | --- |
|
|
17
|
+
| OpenAPI generation | `npm run frontend:openapi` | PASS — 313 paths |
|
|
18
|
+
| Python compile | `npm run check:python` | PASS — 235 modules |
|
|
19
|
+
| Ruff | `node scripts/run_python.mjs -m ruff check .` | PASS |
|
|
20
|
+
| Unit tests | `npm run test:unit -- --tb=short` | PASS — 593 passed, 2 warnings |
|
|
21
|
+
| Live Postgres migration | `LTCAI_LIVE_POSTGRES_DOCKER_CONSENT=1 node scripts/run_python.mjs -m pytest tests/integration/test_v42_postgres_migration_live.py -v --tb=short` | PASS |
|
|
22
|
+
| Live integration | `LTCAI_TEST_BASE_URL=http://127.0.0.1:8899 npm run test:integration -- --tb=short` | PASS — 9 passed, 1 skipped |
|
|
23
|
+
| Frontend lint | `npm run lint` | PASS |
|
|
24
|
+
| TypeScript + VS Code extension build | `npm run typecheck` | PASS |
|
|
25
|
+
| Vite app build | `npm run build:assets` | PASS |
|
|
26
|
+
| Playwright visual/offline suite | `npx playwright test tests/visual/v3.spec.js` | PASS — 12 passed |
|
|
27
|
+
| Tauri desktop check | `npm run desktop:tauri:check` | PASS |
|
|
28
|
+
| Release artifacts | `npm run release:artifacts` | PASS |
|
|
29
|
+
| Artifact validation | `npm run release:validate` | PASS |
|
|
30
|
+
| Wheel smoke | `node scripts/run_python.mjs scripts/wheel_smoke.py --wheel dist/ltcai-4.2.0-py3-none-any.whl` | PASS |
|
|
31
|
+
| npm dry-run | `npm pack --dry-run` | PASS |
|
|
32
|
+
|
|
33
|
+
## Storage-Specific Coverage
|
|
34
|
+
|
|
35
|
+
- `test_v42_brain_storage.py` validates:
|
|
36
|
+
- `lattice_brain` package exports a working Knowledge Graph store.
|
|
37
|
+
- `BrainCore` constructs SQLite graph and durable conversation stores.
|
|
38
|
+
- default storage is SQLite.
|
|
39
|
+
- explicit Postgres without DSN fails honestly.
|
|
40
|
+
- SQLite-to-Postgres migration planning preserves all user tables and
|
|
41
|
+
idempotence keys, including rowid-less FTS5 shadow tables with primary
|
|
42
|
+
keys.
|
|
43
|
+
- Docker setup does not start without explicit consent.
|
|
44
|
+
- encrypted `.latticebrain` archives round-trip DB + blobs.
|
|
45
|
+
- portability service exposes storage status, dry-run migration, and archives.
|
|
46
|
+
- `test_v42_postgres_migration_live.py` validates the explicit-consent Docker
|
|
47
|
+
path with `pgvector/pgvector:pg16`:
|
|
48
|
+
- live pgvector Postgres starts through `DockerPostgresWizard`.
|
|
49
|
+
- v4 SQLite brain data copies without source mutation.
|
|
50
|
+
- table row counts match after migration.
|
|
51
|
+
- rerunning migration is idempotent.
|
|
52
|
+
- pgvector extension and vector distance ordering work.
|
|
53
|
+
- explicit Postgres runtime paths fail closed instead of falling back to
|
|
54
|
+
SQLite.
|
|
55
|
+
- the test Compose stack is torn down with volumes after validation.
|
|
56
|
+
- Existing vector tests continue to validate real local vector search.
|
|
57
|
+
- Existing portability tests continue to validate JSON export/import and ZIP
|
|
58
|
+
backup/restore.
|
|
59
|
+
|
|
60
|
+
## Generated Artifacts
|
|
61
|
+
|
|
62
|
+
- `dist/ltcai-4.2.0-py3-none-any.whl`
|
|
63
|
+
- `dist/ltcai-4.2.0.tar.gz`
|
|
64
|
+
- `dist/ltcai-4.2.0.vsix`
|
|
65
|
+
- `ltcai-4.2.0.tgz`
|
|
66
|
+
|
|
67
|
+
## Warnings
|
|
68
|
+
|
|
69
|
+
- Vite reports the main app chunk is larger than 500 kB; build succeeds.
|
|
70
|
+
- Tauri/Rust reports transitive `block v0.1.6` future-incompatibility warning;
|
|
71
|
+
cargo check succeeds.
|
|
72
|
+
- Release validation warns that older artifacts remain in `dist/`; exact
|
|
73
|
+
v4.2.0 artifact validation passes and publish docs require exact filenames.
|
|
74
|
+
- Wheel smoke in a clean venv reports MLX unavailable; expected when optional
|
|
75
|
+
local MLX runtime is not installed. `/health` still reports version `4.2.0`.
|
|
76
|
+
|
|
77
|
+
## Docker/Postgres Validation
|
|
78
|
+
|
|
79
|
+
Owner granted explicit Docker consent for the v4.2.0 Postgres/pgvector
|
|
80
|
+
migration test. Docker was used only for this validation path. The live test
|
|
81
|
+
started a local `pgvector/pgvector:pg16` Postgres service, migrated a seeded v4
|
|
82
|
+
SQLite brain database, verified row counts, idempotence, pgvector distance
|
|
83
|
+
search, fail-closed Postgres behavior, and then removed the test Compose stack
|
|
84
|
+
and volumes. SQLite remains the default and fully validated runtime.
|
|
85
|
+
|
|
86
|
+
## External Registries
|
|
87
|
+
|
|
88
|
+
No PyPI, npm Registry, VS Code Marketplace, Open VSX, or other external
|
|
89
|
+
registry publish command was run.
|
|
@@ -5,30 +5,27 @@
|
|
|
5
5
|
> completed analysis. **Update this file before ending any phase and before any
|
|
6
6
|
> likely session/context/usage limit.**
|
|
7
7
|
>
|
|
8
|
-
> Last updated: 2026-06-12 — v4.
|
|
8
|
+
> Last updated: 2026-06-12 — v4.2.0 Brain Core/storage release; Remaining Gaps remain empty
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
## 0.
|
|
13
|
-
|
|
14
|
-
**v4.
|
|
15
|
-
`main
|
|
16
|
-
Latest implementation milestone:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
v4.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
Python wheel/sdist build, npm tgz build, VSIX build, release artifact
|
|
30
|
-
validation, wheel smoke, and npm pack dry-run all passed. See
|
|
31
|
-
`docs/V4_1_VALIDATION_REPORT.md`.
|
|
12
|
+
## 0. RELEASE STATUS (v4.2.0)
|
|
13
|
+
|
|
14
|
+
**v4.2.0 extracts Brain Core into `lattice_brain` and adds the pluggable
|
|
15
|
+
storage layer on top of `main` after v4.1.0; implementation gaps remain empty.**
|
|
16
|
+
Latest implementation milestone: FastAPI now constructs the Knowledge Graph and
|
|
17
|
+
durable conversation runtime through `lattice_brain.BrainCore`. The new
|
|
18
|
+
`lattice_brain.storage` package provides `StorageEngine`, `SQLiteEngine`,
|
|
19
|
+
`PostgresEngine`, explicit-consent Docker Postgres setup, SQLite-to-Postgres
|
|
20
|
+
migration tooling, sqlite-vec capability reporting with honest cosine fallback,
|
|
21
|
+
and encrypted `.latticebrain` archive create/restore. Owner-granted Docker
|
|
22
|
+
validation covered live `pgvector/pgvector:pg16` migration integrity,
|
|
23
|
+
rowid-less FTS5 shadow tables, idempotent reruns, pgvector distance search,
|
|
24
|
+
and fail-closed Postgres behavior.
|
|
25
|
+
The v4.2.0 release process builds validated artifacts, tags `v4.2.0`, and
|
|
26
|
+
creates a GitHub Release only. It does not publish to PyPI, npm Registry,
|
|
27
|
+
VS Code Marketplace, Open VSX, or deploy to production targets.
|
|
28
|
+
v4.2.0 validation report: `docs/V4_2_VALIDATION_REPORT.md`.
|
|
32
29
|
Remaining implementation gaps: **none**.
|
|
33
30
|
Owner-only blockers: pptx history rewrite (requires force-push/owner decision)
|
|
34
31
|
and consent-gated production embedder provisioning (silent default download is
|
|
@@ -36,12 +33,13 @@ not permitted).
|
|
|
36
33
|
|
|
37
34
|
## Remaining Gaps
|
|
38
35
|
|
|
39
|
-
None. v4.
|
|
40
|
-
v4.0
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
None. v4.2.0 closes the backend Brain Core/storage rebuild on top of the
|
|
37
|
+
already-empty v4.1.0 gap list: `lattice_brain` is the independent package
|
|
38
|
+
boundary, SQLite remains the default engine, Postgres/pgvector is opt-in and
|
|
39
|
+
honestly unavailable when dependencies or DSN are missing, Docker setup is
|
|
40
|
+
consent-gated, migration planning is non-destructive, and encrypted
|
|
41
|
+
`.latticebrain` archives round-trip the SQLite brain DB plus blobs. Owner-only
|
|
42
|
+
blockers above are intentionally not implementation gaps.
|
|
45
43
|
|
|
46
44
|
## 1. Program Charter (from the user's v4.0.0 directive)
|
|
47
45
|
|
|
@@ -227,9 +225,9 @@ Track log (update at every track boundary):
|
|
|
227
225
|
and KG provenance coverage. en/ko i18n runtime backs routes, shell, and new
|
|
228
226
|
parity views; `scripts/lint_v3.mjs` gates it. Visual coverage moved to the
|
|
229
227
|
v3 surface and legacy-page specs were retired.
|
|
230
|
-
- T9-canvas
|
|
231
|
-
|
|
232
|
-
|
|
228
|
+
- Superseded note: an early T9-canvas handoff left a static v3 graph-canvas file
|
|
229
|
+
unrewired, but this is no longer active work. v4.1.0 removed `static/v3` and
|
|
230
|
+
replaced the graph surface with the React/Vite/Cytoscape Brain view.
|
|
233
231
|
- NOTE: The old T3d queue is closed. T9 parity surfaces remain active with
|
|
234
232
|
full contracts in this file + the plan.
|
|
235
233
|
- **T3e**: docs/kg-schema.md regenerated from enums.
|
|
@@ -285,9 +283,9 @@ the canonical Phase A record.**
|
|
|
285
283
|
services, 27 API routers + `server_app.py` at 1,554 lines). Legacy root
|
|
286
284
|
modules ~6,720 lines incl. `knowledge_graph.py` **4,633 lines**,
|
|
287
285
|
`kg_schema.py` 521, `llm_router.py` 775, `mcp_registry.py` 791.
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
286
|
+
- Historical frontend baseline: `/app` static v3 SPA (`static/v3/`,
|
|
287
|
+
token-native) was primary at v3.6.0. v4.1.0 later replaced it with the
|
|
288
|
+
React/Vite SPA in `frontend/` and `static/app/`.
|
|
291
289
|
- Repo root clutter: ~30 `ltcai-*.tgz` tarballs, `ltcai-0.3.1/` extracted copy,
|
|
292
290
|
logs, `chat_history.json`, 15MB pptx — most likely untracked; verify with
|
|
293
291
|
`git ls-files` before cleaning.
|