ltcai 4.1.0 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/README.md +33 -24
  2. package/docs/CHANGELOG.md +84 -0
  3. package/docs/V4_2_BRAIN_CORE_ARCHITECTURE.md +97 -0
  4. package/docs/V4_2_STORAGE_MIGRATION_REPORT.md +91 -0
  5. package/docs/V4_2_VALIDATION_REPORT.md +89 -0
  6. package/docs/V4_3_PORTABILITY_ARCHITECTURE.md +69 -0
  7. package/docs/V4_3_PRIVACY_AUDIT.md +60 -0
  8. package/docs/V4_3_PRODUCT_HARDENING_REPORT.md +53 -0
  9. package/docs/V4_3_VALIDATION_REPORT.md +58 -0
  10. package/docs/V4_DIGITAL_BRAIN_RECOVERY.md +31 -33
  11. package/frontend/openapi.json +449 -1
  12. package/frontend/src/api/client.ts +10 -0
  13. package/frontend/src/api/openapi.ts +542 -0
  14. package/frontend/src/pages/System.tsx +92 -0
  15. package/kg_schema.py +1 -1
  16. package/knowledge_graph.py +4 -4
  17. package/lattice_brain/__init__.py +70 -0
  18. package/lattice_brain/_kg_common.py +1 -0
  19. package/lattice_brain/archive.py +446 -0
  20. package/lattice_brain/context.py +3 -0
  21. package/lattice_brain/conversations.py +3 -0
  22. package/lattice_brain/core.py +82 -0
  23. package/lattice_brain/discovery.py +1 -0
  24. package/lattice_brain/documents.py +1 -0
  25. package/lattice_brain/embeddings.py +82 -0
  26. package/lattice_brain/identity.py +13 -0
  27. package/lattice_brain/ingest.py +1 -0
  28. package/lattice_brain/memory.py +3 -0
  29. package/lattice_brain/network.py +1 -0
  30. package/lattice_brain/projection.py +1 -0
  31. package/lattice_brain/provenance.py +1 -0
  32. package/lattice_brain/retrieval.py +1 -0
  33. package/lattice_brain/schema.py +1 -0
  34. package/lattice_brain/storage/__init__.py +22 -0
  35. package/lattice_brain/storage/base.py +72 -0
  36. package/lattice_brain/storage/docker.py +105 -0
  37. package/lattice_brain/storage/factory.py +31 -0
  38. package/lattice_brain/storage/migration.py +190 -0
  39. package/lattice_brain/storage/postgres.py +123 -0
  40. package/lattice_brain/storage/sqlite.py +128 -0
  41. package/lattice_brain/store.py +3 -0
  42. package/lattice_brain/write_master.py +1 -0
  43. package/latticeai/__init__.py +1 -1
  44. package/latticeai/api/admin.py +11 -0
  45. package/latticeai/api/portability.py +127 -1
  46. package/latticeai/app_factory.py +26 -10
  47. package/latticeai/brain/__init__.py +6 -6
  48. package/latticeai/brain/_kg_common.py +1 -1
  49. package/latticeai/brain/network.py +1 -1
  50. package/latticeai/brain/retrieval.py +15 -0
  51. package/latticeai/brain/store.py +22 -6
  52. package/latticeai/core/config.py +9 -1
  53. package/latticeai/core/marketplace.py +1 -1
  54. package/latticeai/core/multi_agent.py +1 -1
  55. package/latticeai/core/product_hardening.py +217 -0
  56. package/latticeai/core/workspace_os.py +1 -1
  57. package/latticeai/services/kg_portability.py +227 -3
  58. package/ltcai_cli.py +2 -1
  59. package/package.json +4 -3
  60. package/scripts/bump_version.py +3 -0
  61. package/scripts/clean_release_artifacts.mjs +27 -0
  62. package/scripts/lint_frontend.mjs +10 -0
  63. package/scripts/migrate_brain_storage.py +53 -0
  64. package/scripts/validate_release_artifacts.py +10 -0
  65. package/scripts/wheel_smoke.py +3 -0
  66. package/src-tauri/Cargo.lock +1 -1
  67. package/src-tauri/Cargo.toml +1 -1
  68. package/src-tauri/src/main.rs +113 -13
  69. package/src-tauri/tauri.conf.json +5 -2
  70. package/static/app/asset-manifest.json +5 -5
  71. package/static/app/assets/{index-CJRAzNnf.js → index-RiJTJliG.js} +3 -3
  72. package/static/app/assets/index-RiJTJliG.js.map +1 -0
  73. package/static/app/assets/index-yZswHE3d.css +2 -0
  74. package/static/app/index.html +2 -2
  75. package/static/app/assets/index-CJRAzNnf.js.map +0 -1
  76. package/static/app/assets/index-CSwBBgf4.css +0 -2
package/README.md CHANGED
@@ -203,34 +203,31 @@ npm run dev
203
203
 
204
204
  ## Latest Release
205
205
 
206
- ### v4.1.0 RC — Frontend & Desktop Rebuild
207
-
208
- - **React desktop SPA** — `/app` is now a React + TypeScript + Vite application
209
- with TanStack Query, Zustand, React Flow, Cytoscape.js, Tailwind CSS, and
210
- local shadcn-style primitives.
211
- - **Generated API client** — frontend JSON calls consume the existing FastAPI
212
- contract through a generated OpenAPI TypeScript client; streaming chat and
213
- multipart upload remain honest fetch special cases.
214
- - **Tauri-first desktop shell** — Tauri 2.0 is the primary desktop target,
215
- launching the local backend by default; Electron is retained as a fallback
216
- shell only.
217
- - **Graph-first navigation** — the primary surfaces are Brain, Ask, Capture,
218
- Act, Library, and System, with old `/app#...` routes mapped into the new
219
- capability groups.
220
- - **No CDN / offline-capable** shipped app assets are built into
221
- `static/app`, service-worker precached, and verified to avoid CDN
222
- dependencies.
223
- - **v4.0.1 capability preservation** — Brain Core, storage, agent/workflow
224
- runtime, privacy model, local-first operation, and backend API contracts are
225
- preserved.
226
-
227
- See [RELEASE_NOTES_v4.1.0.md](RELEASE_NOTES_v4.1.0.md),
206
+ ### v4.3.0 RC — Portability & Product Hardening
207
+
208
+ - **Portable `.latticebrain` archives** — encrypted archives now include the
209
+ brain DB, blobs, workspace state, settings, signed bundles, storage metadata,
210
+ provenance, and public device identity metadata.
211
+ - **Safe backup/restore flows** — archive inspect, verify, import, restore, and
212
+ restore dry-run are real API-backed operations; destructive restore requires
213
+ explicit admin confirmation.
214
+ - **Migration safety** — live SQLite-to-Postgres migration creates and verifies
215
+ a pre-migration backup before copying data.
216
+ - **Desktop hardening** — Tauri sidecar startup, status, restart, shutdown, and
217
+ loopback-only/default-off guards are hardened.
218
+ - **Privacy audit surface** token presence alone no longer enables Telegram or
219
+ external connectors; admin status reports storage, backup health, device
220
+ identity, permissions, and opt-in integration state.
221
+ - **Release hardening** — exact-version validation covers wheel, sdist, npm tgz,
222
+ VSIX, and Tauri DMG artifacts.
223
+
224
+ See [RELEASE_NOTES_v4.3.0.md](RELEASE_NOTES_v4.3.0.md),
228
225
  [docs/kg-schema.md](docs/kg-schema.md),
229
226
  [FEATURE_STATUS.md](FEATURE_STATUS.md).
230
227
 
231
228
  ## How it works — every source converges into the graph
232
229
 
233
- As of v4.1.0, data sources flow through the brain ingestion pipeline into
230
+ As of v4.3.0, data sources flow through the brain ingestion pipeline into
234
231
  the Knowledge Graph — no source bypasses it, none becomes an isolated silo:
235
232
 
236
233
  ```text
@@ -246,7 +243,8 @@ source (file · folder · PDF · web URL · browser tab · text)
246
243
  - **The graph is the asset.** Memory, search, and agents are views over it; models
247
244
  read it. Swap a model and your knowledge is unchanged.
248
245
  - **Portable, no cloud.** Export/import the graph as JSON, or take a full local
249
- binary backup (DB + blobs) and restore it.
246
+ binary backup (DB + blobs), encrypted `.latticebrain` archive, or explicit
247
+ SQLite-to-Postgres migration plan and restore it.
250
248
  - **Local-first protects the graph.** It lives in local SQLite on your machine.
251
249
 
252
250
  For the deeper design, see [ARCHITECTURE.md](ARCHITECTURE.md) and
@@ -264,6 +262,13 @@ For the deeper design, see [ARCHITECTURE.md](ARCHITECTURE.md) and
264
262
 
265
263
  - [ARCHITECTURE.md](ARCHITECTURE.md) — workspace, graph, pipeline, and model overview
266
264
  - [docs/architecture.md](docs/architecture.md) — full architecture reference
265
+ - [docs/V4_3_PORTABILITY_ARCHITECTURE.md](docs/V4_3_PORTABILITY_ARCHITECTURE.md) — v4.3.0 portable brain archive architecture
266
+ - [docs/V4_3_PRODUCT_HARDENING_REPORT.md](docs/V4_3_PRODUCT_HARDENING_REPORT.md) — v4.3.0 desktop/product hardening report
267
+ - [docs/V4_3_PRIVACY_AUDIT.md](docs/V4_3_PRIVACY_AUDIT.md) — v4.3.0 privacy and local-first audit
268
+ - [docs/V4_3_VALIDATION_REPORT.md](docs/V4_3_VALIDATION_REPORT.md) — v4.3.0 validation report
269
+ - [docs/V4_2_BRAIN_CORE_ARCHITECTURE.md](docs/V4_2_BRAIN_CORE_ARCHITECTURE.md) — v4.2.0 Brain Core package and storage architecture
270
+ - [docs/V4_2_STORAGE_MIGRATION_REPORT.md](docs/V4_2_STORAGE_MIGRATION_REPORT.md) — v4.2.0 storage migration and archive report
271
+ - [docs/V4_2_VALIDATION_REPORT.md](docs/V4_2_VALIDATION_REPORT.md) — v4.2.0 validation report
267
272
  - [docs/V4_1_FRONTEND_ARCHITECTURE_REVIEW.md](docs/V4_1_FRONTEND_ARCHITECTURE_REVIEW.md) — v4.1.0 frontend and desktop architecture review
268
273
  - [docs/V4_1_FRONTEND_MIGRATION_REPORT.md](docs/V4_1_FRONTEND_MIGRATION_REPORT.md) — v4.1.0 capability migration report
269
274
  - [docs/V4_1_VALIDATION_REPORT.md](docs/V4_1_VALIDATION_REPORT.md) — v4.1.0 validation report
@@ -285,6 +290,8 @@ For the deeper design, see [ARCHITECTURE.md](ARCHITECTURE.md) and
285
290
  ### Releases
286
291
 
287
292
  - [RELEASE_NOTES.md](RELEASE_NOTES.md) — current release notes
293
+ - [RELEASE_NOTES_v4.3.0.md](RELEASE_NOTES_v4.3.0.md)
294
+ - [RELEASE_NOTES_v4.2.0.md](RELEASE_NOTES_v4.2.0.md)
288
295
  - [RELEASE_NOTES_v4.1.0.md](RELEASE_NOTES_v4.1.0.md)
289
296
  - [RELEASE_NOTES_v4.0.1.md](RELEASE_NOTES_v4.0.1.md)
290
297
  - [RELEASE_NOTES_v4.0.0.md](RELEASE_NOTES_v4.0.0.md)
@@ -298,6 +305,8 @@ For the deeper design, see [ARCHITECTURE.md](ARCHITECTURE.md) and
298
305
 
299
306
  | Version | Theme |
300
307
  | --- | --- |
308
+ | **4.3.0** | Portability & Product Hardening RC — portable `.latticebrain` archives, confirmed restore/import, pre-migration backup verification, Tauri sidecar hardening, local-only/default-off integration guards, exact-version DMG validation |
309
+ | **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
310
  | **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
311
  | **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
312
  | **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,89 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.3.0] - 2026-06-12
4
+
5
+ > Portability & Product Hardening release candidate. v4.3.0 preserves the
6
+ > v4.2 Brain Core/storage architecture and adds user-safe portable archives,
7
+ > backup/restore hardening, desktop lifecycle status, and local-only privacy
8
+ > guards.
9
+
10
+ ### Added
11
+
12
+ - `.latticebrain` archive format v2 with encrypted graph DB, blobs, portable
13
+ JSON state, signed bundles, storage metadata, provenance, public device
14
+ identity metadata, manifest hashes, inspect, verify, import, restore, and
15
+ restore dry-run.
16
+ - FastAPI routes for archive inspect/verify/import, backup health, and admin
17
+ product-hardening status.
18
+ - Product-hardening status for local-only startup, storage mode, backup health,
19
+ device identity, import/export permissions, external integration opt-in state,
20
+ and fail-closed archive behavior.
21
+ - Tauri sidecar `backend_status`, `restart_backend`, and `shutdown_backend`
22
+ commands.
23
+ - Release cleaner and exact-version DMG validation.
24
+
25
+ ### Changed
26
+
27
+ - Telegram is disabled by default; token presence alone no longer enables any
28
+ external integration.
29
+ - SQLite-to-Postgres live migration creates and verifies a pre-migration backup
30
+ before copying data.
31
+ - System settings exposes `.latticebrain` export/inspect/verify/dry-run
32
+ restore/confirmed restore through real APIs.
33
+ - OpenAPI client regenerated with 318 paths.
34
+ - Synchronized package/runtime versions to `4.3.0`, including Tauri config and
35
+ `lattice_brain.__version__`.
36
+
37
+ ### Expected Artifacts
38
+
39
+ - `dist/ltcai-4.3.0-py3-none-any.whl`
40
+ - `dist/ltcai-4.3.0.tar.gz`
41
+ - `dist/ltcai-4.3.0.vsix`
42
+ - `ltcai-4.3.0.tgz`
43
+ - `src-tauri/target/release/bundle/dmg/Lattice AI_4.3.0_aarch64.dmg`
44
+
45
+ ## [4.2.0] - 2026-06-12
46
+
47
+ > Brain Core & Storage Rebuild release. The backend Digital Brain boundary is
48
+ > available through the independent `lattice_brain` package, while the v4.1.0
49
+ > frontend, FastAPI contracts, and SQLite user data remain compatible.
50
+
51
+ ### Added
52
+
53
+ - `lattice_brain` import package with `BrainCore`, Knowledge Graph,
54
+ conversation, memory/context, identity/network, archive, and storage facades.
55
+ - Pluggable storage layer: `StorageEngine`, `SQLiteEngine`, `PostgresEngine`,
56
+ `DockerPostgresWizard`, and `SQLiteToPostgresMigrator`.
57
+ - sqlite-vec capability detection with honest `bruteforce-cosine` local vector
58
+ search fallback.
59
+ - Opt-in Postgres/pgvector scale setup and non-destructive SQLite-to-Postgres
60
+ migration planning/copy tooling.
61
+ - Live Docker-backed pgvector migration validation, including rowid-less FTS5
62
+ shadow tables, row-count integrity, idempotent reruns, and fail-closed
63
+ Postgres behavior.
64
+ - Encrypted `.latticebrain` archive create/restore support for the SQLite brain
65
+ database and blob directory.
66
+ - FastAPI routes for storage status, consent-gated Docker setup,
67
+ SQLite-to-Postgres migration, and encrypted archive create/restore.
68
+
69
+ ### Changed
70
+
71
+ - FastAPI constructs the graph/conversation runtime through
72
+ `lattice_brain.BrainCore`; root and `latticeai.brain.*` imports remain
73
+ compatibility shims.
74
+ - OpenAPI client regenerated with 313 paths.
75
+ - System settings exposes API-backed storage status, Docker setup consent, and
76
+ migration planning controls.
77
+ - Synchronized package/runtime versions to `4.2.0`, including Tauri config and
78
+ `lattice_brain.__version__`.
79
+
80
+ ### Expected Artifacts
81
+
82
+ - `dist/ltcai-4.2.0-py3-none-any.whl`
83
+ - `dist/ltcai-4.2.0.tar.gz`
84
+ - `dist/ltcai-4.2.0.vsix`
85
+ - `ltcai-4.2.0.tgz`
86
+
3
87
  ## [4.1.0] - 2026-06-12
4
88
 
5
89
  > 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.
@@ -0,0 +1,69 @@
1
+ # Lattice AI v4.3.0 Portability Architecture
2
+
3
+ ## Scope
4
+
5
+ v4.3.0 hardens the v4.2 Brain Core/storage architecture without redesigning it.
6
+ The primary portable brain format is the encrypted `.latticebrain` archive.
7
+ FastAPI remains the only boundary consumed by the frontend and desktop shell.
8
+
9
+ ## `.latticebrain` Archive Format
10
+
11
+ The archive is a JSON envelope with:
12
+
13
+ - `format = latticebrain.encrypted`
14
+ - `format_version = 2`
15
+ - PBKDF2-HMAC-SHA256 key derivation metadata
16
+ - AES-256-GCM cipher metadata
17
+ - encrypted ZIP payload
18
+ - payload SHA-256
19
+ - non-secret manifest summary for inspection
20
+
21
+ The encrypted payload contains:
22
+
23
+ - `knowledge_graph.sqlite`
24
+ - `blobs/` from the Knowledge Graph blob store
25
+ - portable JSON state under `data/`
26
+ - signed graph export bundles under `workspace_exports/`
27
+ - `manifest.json` with entry hashes, section flags, storage metadata,
28
+ public device identity metadata, provenance, and version.
29
+
30
+ Private key material such as `device_identity.key` is deliberately excluded.
31
+
32
+ ## Operations
33
+
34
+ - Export: `POST /api/knowledge-graph/archive`
35
+ - Inspect: `POST /api/knowledge-graph/archive/inspect`
36
+ - Verify: `POST /api/knowledge-graph/archive/verify`
37
+ - Import: `POST /api/knowledge-graph/archive/import`
38
+ - Restore: `POST /api/knowledge-graph/archive/restore`
39
+ - Backup health: `GET /api/knowledge-graph/backup-health`
40
+
41
+ Restore/import fail closed unless the request is a dry run or includes
42
+ `confirm: true`.
43
+
44
+ ## Compatibility
45
+
46
+ - v1 `.latticebrain` payloads that contain only DB/blob data remain restorable.
47
+ - SQLite remains the default source and target.
48
+ - Postgres scale-mode brains export through safe logical/archive semantics; the
49
+ migration tooling still requires explicit DSN and does not silently fall back.
50
+ - Existing Knowledge Graph JSON exports and ZIP backups remain supported.
51
+
52
+ ## Integrity Policy
53
+
54
+ Archives fail closed on:
55
+
56
+ - bad passphrase
57
+ - corrupt envelope
58
+ - corrupt ZIP payload
59
+ - payload SHA mismatch
60
+ - missing brain database
61
+ - manifest hash mismatch
62
+ - unsupported future archive version
63
+ - unsafe ZIP member paths
64
+
65
+ ## User Safety
66
+
67
+ Destructive restore operations require admin permission and explicit
68
+ confirmation. Dry-run restore returns the target paths and payload sections
69
+ without mutating user data.
@@ -0,0 +1,60 @@
1
+ # Lattice AI v4.3.0 Privacy And Local-First Audit
2
+
3
+ ## Default Startup
4
+
5
+ Default local startup is loopback-only and local-first:
6
+
7
+ - host: `127.0.0.1`
8
+ - Telegram disabled
9
+ - model autoload disabled in local mode
10
+ - network CORS disabled
11
+ - storage engine: SQLite
12
+ - embedding provider: local hash fallback
13
+ - Docker not auto-started
14
+ - Postgres not required
15
+ - updater checks disabled unless explicitly enabled
16
+
17
+ ## Token Presence Policy
18
+
19
+ Credentials alone do not enable outbound communication. The product-hardening
20
+ status distinguishes `credential_present` from `enabled`.
21
+
22
+ Audited integrations:
23
+
24
+ - Telegram: requires `LATTICEAI_ENABLE_TELEGRAM=true`
25
+ - Brain Network: peer push is explicit user/admin action; no automatic sync
26
+ - Update checks: require `LATTICEAI_ENABLE_UPDATES=true`
27
+ - Model downloads: require explicit load/autoload/user action
28
+ - Docker setup: requires runtime consent
29
+ - Postgres: requires explicit storage engine and DSN
30
+ - External connectors: credentials are inert until connector enablement and
31
+ invocation
32
+
33
+ ## Tests
34
+
35
+ Unit coverage proves:
36
+
37
+ - default config is local-only
38
+ - Telegram is disabled by default
39
+ - Telegram token presence alone does not enable Telegram
40
+ - cloud/API-token presence alone does not enable external connectors
41
+ - product hardening status reports opt-in egress honestly
42
+
43
+ ## Desktop Guardrails
44
+
45
+ Tauri sidecar startup sets local-only environment overrides for the packaged
46
+ backend. Desktop status commands expose missing backend/runtime failures as
47
+ honest unavailable states.
48
+
49
+ ## CLI Guardrails
50
+
51
+ The CLI startup notification path now requires `LATTICEAI_ENABLE_TELEGRAM=true`;
52
+ Telegram bot token and chat ID presence alone no longer starts a notification
53
+ thread.
54
+
55
+ ## Remaining Owner-Only Privacy Decisions
56
+
57
+ - Package registry publication remains owner-only.
58
+ - Production model downloads remain explicit user action or policy opt-in.
59
+ - History rewrite for old binary assets remains owner-only because it requires a
60
+ force push.
@@ -0,0 +1,53 @@
1
+ # Lattice AI v4.3.0 Product Hardening Report
2
+
3
+ ## Summary
4
+
5
+ v4.3.0 turns the v4.2 Brain Core/storage release into a safer desktop product
6
+ without changing the Brain Core, storage, frontend, agent, or workflow
7
+ architecture.
8
+
9
+ ## Desktop Shell
10
+
11
+ - Tauri sidecar startup now records command, PID, origin, running state, and
12
+ last error.
13
+ - Tauri exposes `backend_status`, `restart_backend`, and `shutdown_backend`
14
+ commands.
15
+ - Sidecar startup forces loopback host, disables Telegram, disables autoloaded
16
+ models, disables network CORS, and disables tunnels.
17
+ - Missing Python or backend command failures are stored as actionable desktop
18
+ status instead of being hidden.
19
+
20
+ ## Backup And Restore
21
+
22
+ - `.latticebrain` archive export/inspect/verify/import/restore is API-backed.
23
+ - Backup health is exposed through FastAPI and the System settings view.
24
+ - Restore dry-run verifies the archive and returns planned targets without
25
+ mutation.
26
+ - Restore/import requires explicit confirmation for destructive execution.
27
+ - SQLite-to-Postgres live migration now creates and verifies a pre-migration
28
+ SQLite backup before copying data.
29
+
30
+ ## Admin Status
31
+
32
+ `GET /admin/product-hardening` reports:
33
+
34
+ - local-only startup posture
35
+ - storage mode
36
+ - backup health
37
+ - public device identity metadata
38
+ - external integration opt-in state
39
+ - admin import/export/restore permissions
40
+ - fail-closed behavior for archive and restore errors
41
+
42
+ ## Release Packaging
43
+
44
+ - Release artifact validation now checks the exact Tauri DMG path.
45
+ - Release artifact build script cleans only target-version outputs before
46
+ rebuilding.
47
+ - Historical artifacts remain visible so `dist/*` upload mistakes are still
48
+ detectable.
49
+
50
+ ## Registry Policy
51
+
52
+ v4.3.0 RC work builds and validates artifacts only. It does not publish to PyPI,
53
+ npm Registry, VS Code Marketplace, Open VSX, or any other external registry.