ltcai 4.0.0 → 4.1.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 (195) hide show
  1. package/README.md +42 -33
  2. package/desktop/electron/main.cjs +44 -0
  3. package/docs/CHANGELOG.md +106 -0
  4. package/docs/REALTIME_COLLABORATION.md +3 -3
  5. package/docs/V3_FRONTEND.md +9 -8
  6. package/docs/V4_1_FRONTEND_ARCHITECTURE_REVIEW.md +65 -0
  7. package/docs/V4_1_FRONTEND_MIGRATION_REPORT.md +70 -0
  8. package/docs/V4_1_VALIDATION_REPORT.md +47 -0
  9. package/docs/V4_DIGITAL_BRAIN_RECOVERY.md +95 -45
  10. package/docs/kg-schema.md +6 -2
  11. package/docs/spec-vs-impl.md +10 -10
  12. package/frontend/index.html +24 -0
  13. package/frontend/openapi.json +14190 -0
  14. package/frontend/src/App.tsx +184 -0
  15. package/frontend/src/api/client.ts +317 -0
  16. package/frontend/src/api/openapi.ts +16637 -0
  17. package/frontend/src/components/primitives.tsx +204 -0
  18. package/frontend/src/components/ui/badge.tsx +27 -0
  19. package/frontend/src/components/ui/button.tsx +37 -0
  20. package/frontend/src/components/ui/card.tsx +22 -0
  21. package/frontend/src/components/ui/input.tsx +16 -0
  22. package/frontend/src/components/ui/textarea.tsx +16 -0
  23. package/frontend/src/lib/utils.ts +33 -0
  24. package/frontend/src/main.tsx +23 -0
  25. package/frontend/src/pages/Act.tsx +245 -0
  26. package/frontend/src/pages/Ask.tsx +200 -0
  27. package/frontend/src/pages/Brain.tsx +267 -0
  28. package/frontend/src/pages/Capture.tsx +158 -0
  29. package/frontend/src/pages/Library.tsx +187 -0
  30. package/frontend/src/pages/System.tsx +344 -0
  31. package/frontend/src/routes.ts +85 -0
  32. package/frontend/src/store/appStore.ts +54 -0
  33. package/frontend/src/styles.css +107 -0
  34. package/kg_schema.py +2 -603
  35. package/knowledge_graph.py +37 -4958
  36. package/latticeai/__init__.py +1 -1
  37. package/latticeai/api/admin.py +15 -16
  38. package/latticeai/api/agents.py +13 -6
  39. package/latticeai/api/auth.py +19 -11
  40. package/latticeai/api/invitations.py +100 -0
  41. package/latticeai/api/knowledge_graph.py +4 -11
  42. package/latticeai/api/plugins.py +3 -6
  43. package/latticeai/api/realtime.py +4 -7
  44. package/latticeai/api/setup.py +5 -4
  45. package/latticeai/api/static_routes.py +13 -16
  46. package/latticeai/api/ui_redirects.py +26 -0
  47. package/latticeai/api/workflow_designer.py +39 -6
  48. package/latticeai/api/workspace.py +24 -10
  49. package/latticeai/app_factory.py +88 -17
  50. package/latticeai/brain/_kg_common.py +1123 -0
  51. package/latticeai/brain/discovery.py +1455 -0
  52. package/latticeai/brain/documents.py +218 -0
  53. package/latticeai/brain/ingest.py +644 -0
  54. package/latticeai/brain/projection.py +561 -0
  55. package/latticeai/brain/provenance.py +401 -0
  56. package/latticeai/brain/retrieval.py +1316 -0
  57. package/latticeai/brain/schema.py +640 -0
  58. package/latticeai/brain/store.py +216 -0
  59. package/latticeai/brain/write_master.py +225 -0
  60. package/latticeai/core/invitations.py +131 -0
  61. package/latticeai/core/marketplace.py +1 -1
  62. package/latticeai/core/multi_agent.py +1 -1
  63. package/latticeai/core/policy.py +54 -0
  64. package/latticeai/core/realtime.py +65 -44
  65. package/latticeai/core/sessions.py +31 -5
  66. package/latticeai/core/users.py +147 -0
  67. package/latticeai/core/workspace_os.py +420 -20
  68. package/latticeai/services/agent_runtime.py +242 -4
  69. package/latticeai/services/run_executor.py +328 -0
  70. package/latticeai/services/workspace_service.py +27 -19
  71. package/package.json +54 -27
  72. package/scripts/build_frontend_assets.mjs +38 -0
  73. package/scripts/bump_version.py +1 -1
  74. package/scripts/export_openapi.py +31 -0
  75. package/scripts/lint_frontend.mjs +86 -0
  76. package/scripts/run_python.mjs +47 -0
  77. package/src-tauri/Cargo.lock +4833 -0
  78. package/src-tauri/Cargo.toml +19 -0
  79. package/src-tauri/build.rs +3 -0
  80. package/src-tauri/capabilities/default.json +7 -0
  81. package/src-tauri/src/main.rs +78 -0
  82. package/src-tauri/tauri.conf.json +36 -0
  83. package/static/app/asset-manifest.json +32 -0
  84. package/static/app/assets/core-CwxXejkd.js +2 -0
  85. package/static/app/assets/core-CwxXejkd.js.map +1 -0
  86. package/static/app/assets/index-CJRAzNnf.js +333 -0
  87. package/static/app/assets/index-CJRAzNnf.js.map +1 -0
  88. package/static/app/assets/index-CSwBBgf4.css +2 -0
  89. package/static/app/index.html +25 -0
  90. package/static/manifest.json +2 -2
  91. package/static/sw.js +4 -4
  92. package/scripts/build_v3_assets.mjs +0 -170
  93. package/scripts/lint_v3.mjs +0 -97
  94. package/static/account.html +0 -113
  95. package/static/activity.html +0 -73
  96. package/static/admin.html +0 -486
  97. package/static/agents.html +0 -139
  98. package/static/chat.html +0 -841
  99. package/static/css/reference/account.css +0 -439
  100. package/static/css/reference/admin.css +0 -610
  101. package/static/css/reference/base.css +0 -1661
  102. package/static/css/reference/chat.css +0 -4623
  103. package/static/css/reference/graph.css +0 -1016
  104. package/static/css/responsive.css +0 -861
  105. package/static/graph.html +0 -122
  106. package/static/platform.css +0 -104
  107. package/static/plugins.html +0 -136
  108. package/static/scripts/account.js +0 -238
  109. package/static/scripts/admin.js +0 -1614
  110. package/static/scripts/chat.js +0 -5081
  111. package/static/scripts/graph.js +0 -1804
  112. package/static/scripts/platform.js +0 -64
  113. package/static/scripts/ux.js +0 -167
  114. package/static/scripts/workspace.js +0 -948
  115. package/static/v3/asset-manifest.json +0 -56
  116. package/static/v3/css/lattice.base.49deefb5.css +0 -128
  117. package/static/v3/css/lattice.base.css +0 -128
  118. package/static/v3/css/lattice.components.cde18231.css +0 -472
  119. package/static/v3/css/lattice.components.css +0 -472
  120. package/static/v3/css/lattice.shell.29d36d85.css +0 -452
  121. package/static/v3/css/lattice.shell.css +0 -452
  122. package/static/v3/css/lattice.tokens.304cbc40.css +0 -135
  123. package/static/v3/css/lattice.tokens.css +0 -135
  124. package/static/v3/css/lattice.views.0a18b6c5.css +0 -360
  125. package/static/v3/css/lattice.views.css +0 -360
  126. package/static/v3/index.html +0 -68
  127. package/static/v3/js/app.356e6452.js +0 -26
  128. package/static/v3/js/app.js +0 -26
  129. package/static/v3/js/core/api.7a308b89.js +0 -568
  130. package/static/v3/js/core/api.js +0 -568
  131. package/static/v3/js/core/components.f25b3b93.js +0 -230
  132. package/static/v3/js/core/components.js +0 -230
  133. package/static/v3/js/core/dom.a2773eb0.js +0 -148
  134. package/static/v3/js/core/dom.js +0 -148
  135. package/static/v3/js/core/router.584570f2.js +0 -37
  136. package/static/v3/js/core/router.js +0 -37
  137. package/static/v3/js/core/routes.7222343d.js +0 -93
  138. package/static/v3/js/core/routes.js +0 -93
  139. package/static/v3/js/core/shell.a1657f20.js +0 -391
  140. package/static/v3/js/core/shell.js +0 -391
  141. package/static/v3/js/core/store.204a08b2.js +0 -113
  142. package/static/v3/js/core/store.js +0 -113
  143. package/static/v3/js/views/admin-audit.660a1fb1.js +0 -185
  144. package/static/v3/js/views/admin-audit.js +0 -185
  145. package/static/v3/js/views/admin-permissions.a7ae5f09.js +0 -177
  146. package/static/v3/js/views/admin-permissions.js +0 -177
  147. package/static/v3/js/views/admin-policies.3658fd86.js +0 -102
  148. package/static/v3/js/views/admin-policies.js +0 -102
  149. package/static/v3/js/views/admin-private-vpc.7d342d36.js +0 -135
  150. package/static/v3/js/views/admin-private-vpc.js +0 -135
  151. package/static/v3/js/views/admin-security.07c66b72.js +0 -180
  152. package/static/v3/js/views/admin-security.js +0 -180
  153. package/static/v3/js/views/admin-users.03bac88c.js +0 -168
  154. package/static/v3/js/views/admin-users.js +0 -168
  155. package/static/v3/js/views/agents.014d0b74.js +0 -541
  156. package/static/v3/js/views/agents.js +0 -541
  157. package/static/v3/js/views/chat.e6dd7dd0.js +0 -601
  158. package/static/v3/js/views/chat.js +0 -601
  159. package/static/v3/js/views/files.adad14c1.js +0 -365
  160. package/static/v3/js/views/files.js +0 -365
  161. package/static/v3/js/views/graph-canvas.17c15d65.js +0 -509
  162. package/static/v3/js/views/graph-canvas.js +0 -509
  163. package/static/v3/js/views/home.24f8b8ae.js +0 -200
  164. package/static/v3/js/views/home.js +0 -200
  165. package/static/v3/js/views/hooks.37895880.js +0 -220
  166. package/static/v3/js/views/hooks.js +0 -220
  167. package/static/v3/js/views/hybrid-search.2fb63ed9.js +0 -194
  168. package/static/v3/js/views/hybrid-search.js +0 -194
  169. package/static/v3/js/views/knowledge-graph.5e40cbeb.js +0 -509
  170. package/static/v3/js/views/knowledge-graph.js +0 -509
  171. package/static/v3/js/views/marketplace.ab0583d4.js +0 -141
  172. package/static/v3/js/views/marketplace.js +0 -141
  173. package/static/v3/js/views/mcp.99b5c6a7.js +0 -114
  174. package/static/v3/js/views/mcp.js +0 -114
  175. package/static/v3/js/views/memory.4ebdf474.js +0 -147
  176. package/static/v3/js/views/memory.js +0 -147
  177. package/static/v3/js/views/models.a1ffa147.js +0 -256
  178. package/static/v3/js/views/models.js +0 -256
  179. package/static/v3/js/views/my-computer.d9d9ae1c.js +0 -463
  180. package/static/v3/js/views/my-computer.js +0 -463
  181. package/static/v3/js/views/pipeline.c522f1ce.js +0 -157
  182. package/static/v3/js/views/pipeline.js +0 -157
  183. package/static/v3/js/views/planning.9ac3e313.js +0 -153
  184. package/static/v3/js/views/planning.js +0 -153
  185. package/static/v3/js/views/settings.8631fa5e.js +0 -318
  186. package/static/v3/js/views/settings.js +0 -318
  187. package/static/v3/js/views/skills.c6c2f965.js +0 -109
  188. package/static/v3/js/views/skills.js +0 -109
  189. package/static/v3/js/views/tools.e4f11276.js +0 -108
  190. package/static/v3/js/views/tools.js +0 -108
  191. package/static/v3/js/views/workflows.26c57290.js +0 -128
  192. package/static/v3/js/views/workflows.js +0 -128
  193. package/static/workflows.html +0 -146
  194. package/static/workspace.css +0 -1121
  195. package/static/workspace.html +0 -357
@@ -5,22 +5,43 @@
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 — RELEASE CANDIDATE PREPARED (Phase D complete; awaiting human review)
8
+ > Last updated: 2026-06-12 — v4.1.0 frontend/desktop rebuild RC; Remaining Gaps remain empty
9
9
 
10
10
  ---
11
11
 
12
- ## 0. RC STATUS (final)
13
-
14
- **v4.0.0 release candidate is on `origin/feat/v4-digital-brain`.**
15
- Validation: 571 unit tests pass · ruff clean · check:python 186 modules ·
16
- lint_v3 all checks · installed-wheel smoke (19 modules from clean venv) ·
17
- release artifacts validated (wheel + sdist + npm tgz, 2.0MB).
18
- NO merge, NO tag, NO publish awaiting review.
19
- Remaining gaps (labeled in FEATURE_STATUS.md §v4.0.0 + RELEASE_NOTES_v4.0.0.md):
20
- T3d decomposition/v2-flip, T7c async engine, T6 remainder (UUIDs/policy/
21
- invitations/SQLite state), T9 remainder (legacy deletion + parity views,
22
- login, i18n, T9b surfaces), pptx history rewrite (owner), consent-gated
23
- embedder provisioning. All contracts live in docs/V4_IMPLEMENTATION_PLAN.md.
12
+ ## 0. RC STATUS (v4.1.0 RC)
13
+
14
+ **v4.1.0 replaces the frontend implementation and desktop shell on top of
15
+ `main @ v4.0.1`; implementation gaps remain empty.**
16
+ Latest implementation milestone: `/app` is now a React + TypeScript + Vite SPA
17
+ with TanStack Query, Zustand, generated OpenAPI client usage, Cytoscape.js
18
+ Brain graph, React Flow Act graph, Tailwind CSS, and local shadcn-style
19
+ primitives. Tauri 2.0 is the primary desktop shell; Electron is fallback only.
20
+ The existing FastAPI backend, Brain Core, storage architecture, and
21
+ agent/workflow runtime remain the source of truth.
22
+ The v4.1.0 RC process builds and validates local artifacts only. It does not
23
+ publish to PyPI, npm Registry, VS Code Marketplace, Open VSX, or production
24
+ deployment targets.
25
+ v4.1.0 validation completed: OpenAPI generation (308 paths), Python compile,
26
+ ruff, 585 unit tests, 9 live integration tests, frontend lint/no-CDN/API
27
+ compatibility, TypeScript build, 12 Playwright visual/offline tests, Tauri
28
+ cargo check, Tauri `.app` + DMG build, Electron fallback syntax/version check,
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`.
32
+ Remaining implementation gaps: **none**.
33
+ Owner-only blockers: pptx history rewrite (requires force-push/owner decision)
34
+ and consent-gated production embedder provisioning (silent default download is
35
+ not permitted).
36
+
37
+ ## Remaining Gaps
38
+
39
+ None. v4.1.0 closes the frontend/desktop rebuild on top of the already-empty
40
+ v4.0.1 gap list: legacy static v3 frontend assets are removed, `/app` is served
41
+ from `static/app`, Brain/Ask/Capture/Act/Library/System cover the existing
42
+ capability surface, and every visible control either calls an existing backend
43
+ API or presents an honest unavailable/error state. Owner-only blockers above
44
+ are intentionally not implementation gaps.
24
45
 
25
46
  ## 1. Program Charter (from the user's v4.0.0 directive)
26
47
 
@@ -55,7 +76,7 @@ chat-history import added; garden = watched source; T9b UI track added;
55
76
  T7 owns workflow_engine.py + realtime.py with suspension/reconciliation
56
77
  specs; tracks run strictly serially). Review record:
57
78
  `docs/v4-audit/v4_design_review.json`.
58
- **Phase C (Implementation) — T1 COMPLETE; next: T2 (Packaging & app factory).**
79
+ **Phase C (Implementation) — COMPLETE on main. Remaining implementation gaps are empty.**
59
80
 
60
81
  Track log (update at every track boundary):
61
82
  - **T2 DONE** (commit `5e8aa1b`, 74 files). Agent did ~90% then died on a
@@ -98,10 +119,15 @@ Track log (update at every track boundary):
98
119
  mark_superseded(). Suite 507.
99
120
  - **T3e DONE**: docs/kg-schema.md rewritten to match code (false API
100
121
  claims removed; FTS5/scope/temporal documented).
101
- - RESEQUENCING DECISION: T3d (decomposition + write-mastering flip) is
102
- agent-scale and limit-blocked until ~17:30 KST; T4 sub-units proceed
103
- inline meanwhile safe because T4 rewires *callers* onto public store
104
- APIs which T3d preserves (suite-green gate).
122
+ - **T3d DONE**: `knowledge_graph.py` is now a root compatibility shim;
123
+ implementation moved under `latticeai/brain/` (`store`, `schema`,
124
+ `projection`, `write_master`, `discovery`, `ingest`, `provenance`,
125
+ `documents`, `retrieval`), with every module under 1,500 lines. v2 is
126
+ the authoritative write door; legacy tables are maintained as the
127
+ compatibility projection. Startup creates a one-time pre-flip SQLite
128
+ backup for existing graph data, stamps `PRAGMA user_version=4`, refuses
129
+ newer DB formats, and preserves legacy read/import compatibility.
130
+ Focused KG validation: 43 passed.
105
131
  - **T4.1 DONE** (commits `427d6a3` + `a2a1445`): chat (app_factory
106
132
  save_to_history), MCP (/mcp/call knowledge_graph_ingest), and uploads
107
133
  (upload_service) all route through IngestionPipeline — new
@@ -164,6 +190,16 @@ Track log (update at every track boundary):
164
190
  accept allowed_workspaces; search router scopes via _ScopedSearchService
165
191
  proxy + PLATFORM.allowed_scopes; ContextAssembler hybrid seam scoped per
166
192
  user. Legacy NULL rows machine-visible (documented). Suite 564.
193
+ - **T6-remainder DONE**: users now carry stable `user:<uuid>` identities
194
+ with non-destructive `users.json` migration; sessions store UUID subjects
195
+ while preserving email compatibility; workspace memberships/owners and KG
196
+ identity columns migrate from email strings to UUIDs. `core/policy.py` is the
197
+ enforced role/capability map behind admin dependencies and `/admin/roles`.
198
+ Invitations are real local tokens (create/list/accept/expire) and accepted
199
+ workspace invites add UUID-keyed members. Workspace OS state imports once from
200
+ JSON into the same `knowledge_graph.sqlite`, mirrors JSON for compatibility,
201
+ writes transactionally, and no longer truncates durable history collections.
202
+ Suite: 583.
167
203
  - **T7d DONE** (commit 235f9b6): latticeai/services/triggers.py —
168
204
  interval scheduler (missed-while-down → recorded skip events, no
169
205
  catch-up) + brain_event triggers via visible post_tool hook on
@@ -171,29 +207,31 @@ Track log (update at every track boundary):
171
207
  status; started in app factory w/ idempotent hook registration. Suite 569.
172
208
  - **T7e DONE** (commit 014ca91): custom registry agents executable
173
209
  (config actually loaded; honest skip in simulation).
210
+ - **T7c DONE**: `latticeai/services/run_executor.py` owns durable asyncio
211
+ server-loop tasks for agent/workflow runs. `/agents/api/run` and workflow
212
+ definition runs now persist queued rows, execute sync orchestrator/tool work
213
+ via `asyncio.to_thread`, update the same run row through running/final states,
214
+ publish progress through the existing realtime SSE feed, support cooperative
215
+ cancellation, and reconcile orphaned active runs to `interrupted` at startup
216
+ while preserving `awaiting_approval` pause cursors. `RealtimeBus.publish` is
217
+ thread-safe via subscriber-loop `call_soon_threadsafe`. Suite: 579.
174
218
  - **T9-canvas DONE** (commit 2fee077): force-directed canvas explorer
175
219
  (graph-canvas.js + Explore rewire; visual spec updated).
176
220
  - **T9-IA DONE** (commit 972d34c): brain-first nav (Brain/Ask/Capture/
177
221
  Act/Library/System); knowledge-graph is the default landing route.
178
- - **PHASE D DECISION**: moving to T10 RC prep. REMAINING GAPS (honest,
179
- labeled, not faked): T3d brain decomposition + v2 write-mastering flip;
180
- T7c async run engine/cancellation/SSE/startup reconciliation; T6
181
- remainder (user UUIDs, enforced policy module, invitations, workspace
182
- SQLite state); T9 remainder (legacy page deletion + parity views, login
183
- rebuild, artifact ungitting, i18n, T9b approval/network/trace surfaces).
184
- All have full contracts in docs/V4_IMPLEMENTATION_PLAN.md + amendments.
222
+ - **T9 REMAINDER DONE**: legacy static pages and scripts deleted; legacy GET
223
+ routes redirect into `/app`; parity views added for account/profile,
224
+ workspaces/org members/invitations/activation, snapshots/time-machine with
225
+ merge-restore, activity/presence, run approvals/cancellation, workflow
226
+ trigger configuration/status, Brain Network pairing/push, chat context trace,
227
+ and KG provenance coverage. en/ko i18n runtime backs routes, shell, and new
228
+ parity views; `scripts/lint_v3.mjs` gates it. Visual coverage moved to the
229
+ v3 surface and legacy-page specs were retired.
185
230
  - T9-canvas agent left static/v3/js/views/graph-canvas.js (509 lines,
186
231
  node --check passes) but NEVER rewired knowledge-graph.js — file kept
187
232
  uncommitted in tree; integration outstanding.
188
- - NOTE: T3d + T9-canvas agents died instantly on session limits THREE times
189
- (latest reset 4:10am KST)
190
- (next reset 23:00 KST); both tasks remain queued with full contracts in
191
- this file + the plan.
192
- - **T3d** (agent task after limits reset 17:30 KST): latticeai/brain/
193
- decomposition (store/discovery/ingest/provenance/documents/extraction,
194
- ≤1,500 lines/module, no mixin god-object) + v2 write-mastering flip
195
- (backup-first, re-entrant migrator keyed on data state, downgrade
196
- marker via PRAGMA user_version, equivalence scoped to pre-flip data).
233
+ - NOTE: The old T3d queue is closed. T9 parity surfaces remain active with
234
+ full contracts in this file + the plan.
197
235
  - **T3e**: docs/kg-schema.md regenerated from enums.
198
236
  - graph_curator decision moved to T4.
199
237
  - **T9 PARTIAL — vendoring half DONE** (commit `aa613ae`, parallel-safe per
@@ -201,9 +239,7 @@ Track log (update at every track boundary):
201
239
  Tabler icons, chart.js, marked.js vendored under static/vendor);
202
240
  --lt3-on-accent token added; sw.js rebuilt around the v3 manifest;
203
241
  lint_v3.mjs now mechanically enforces token/inline-style/CDN rules;
204
- 6 guard tests. REMAINING T9: canvas graph port (item 2), IA regroup (1),
205
- legacy deletion + redirects (3, needs parity views), login rebuild,
206
- artifact ungitting, i18n, T9b surfaces (after T7/T8).
242
+ 6 guard tests. Closed later by T9-canvas, T9-IA, and T9 remainder.
207
243
  - **T1 DONE** (commits `1cddc67` frontend + `c574eb6` backend). All 7 items:
208
244
  by-id snapshot/memory authz via new WorkspaceService.authorize_record_read/
209
245
  authorize_memory_delete; /workspace/os leak removed (workspace_count
@@ -249,8 +285,9 @@ the canonical Phase A record.**
249
285
  services, 27 API routers + `server_app.py` at 1,554 lines). Legacy root
250
286
  modules ~6,720 lines incl. `knowledge_graph.py` **4,633 lines**,
251
287
  `kg_schema.py` 521, `llm_router.py` 775, `mcp_registry.py` 791.
252
- - Frontend: `/app` v3 SPA (`static/v3/`, 22 views, token-native) is primary;
253
- legacy static HTML pages (`static/*.html`) still shipped in parallel.
288
+ - Frontend: `/app` v3 SPA (`static/v3/`, token-native) is primary; legacy
289
+ static HTML pages were later removed and compatibility routes redirect
290
+ into `/app`.
254
291
  - Repo root clutter: ~30 `ltcai-*.tgz` tarballs, `ltcai-0.3.1/` extracted copy,
255
292
  logs, `chat_history.json`, 15MB pptx — most likely untracked; verify with
256
293
  `git ls-files` before cleaning.
@@ -495,15 +532,28 @@ retained for context only:
495
532
 
496
533
  ## 11. Branch Status
497
534
 
498
- - `feat/v4-digital-brain` exists locally, based on main @ 5889195 (v3.6.0).
499
- - Not yet pushed to origin. No implementation commits yet.
535
+ - `main` contains the v4 implementation through T9 remainder closure and is
536
+ pushed to `origin/main` at every verified milestone.
537
+ - No tag, package publish, release upload, production deployment, force-push, or
538
+ history rewrite has been performed.
500
539
 
501
540
  ## 12. Validation Status
502
541
 
503
- - main baseline: 455 unit pass / 9 pre-existing integration failures
504
- (ConnectError, need live server). Nothing run on the branch yet beyond this.
542
+ - Full unit suite: `.venv/bin/python -m pytest tests/unit -q` **585 passed,
543
+ 2 warnings**.
544
+ - Focused T9 tests: `tests/unit/test_workspace_os.py`,
545
+ `tests/unit/test_static_release_hygiene.py`, and `tests/visual/v3.spec.js`
546
+ passed after the parity/legacy-retirement changes.
547
+ - Static and code gates: `.venv/bin/python -m ruff check .`,
548
+ `.venv/bin/python scripts/check_python.py`, `npm run lint`,
549
+ `npm run build:assets`, and `node --check` on changed/new v3 JS passed.
550
+ - Build/package gates: `.venv/bin/python -m build`,
551
+ `.venv/bin/python scripts/wheel_smoke.py`, and `npm pack --dry-run` passed.
505
552
 
506
553
  ## 13. Files Modified (branch vs main)
507
554
 
508
- - `docs/V4_DIGITAL_BRAIN_RECOVERY.md` (this file) NEW.
509
- - (none else yet)
555
+ - T9 remainder changed backend compatibility redirects and SPA-facing APIs,
556
+ Workspace OS snapshot restore, v3 shell/routing/store/i18n/API modules, new
557
+ parity views, asset manifests, package/static inclusion rules, unit and visual
558
+ tests, mocks, release/status documentation, and removed retired legacy static
559
+ pages/scripts/CSS/tests.
package/docs/kg-schema.md CHANGED
@@ -205,8 +205,12 @@ provenance(source_type, source_uri, content_hash, captured_at, modified_at,
205
205
  `knowledge_graph.KnowledgeGraphStore` 가 열릴 때 v2 스키마를 생성/치유하고
206
206
  (`kg_schema.KGStoreV2.init_schema` — 추가 컬럼은 `ALTER` 로 in-place 치유,
207
207
  edges_v2 식별자 변경은 create→copy→swap 으로 재구축), legacy 데이터를
208
- v2 로 백필한다. 기존 `nodes` / `edges` 테이블은 건드리지 않는다 v4
209
- write-mastering 전환(T3d) 전까지 legacy 가 쓰기 마스터다.
208
+ v2 로 백필한다. 기존 `nodes` / `edges` 테이블은 삭제하지 않는다. v4 에서는
209
+ `nodes_v2` / `edges_v2` 가 쓰기 마스터이며, legacy 테이블은 이전 import/API
210
+ 소비자를 위한 compatibility projection 으로 같은 트랜잭션에서 갱신된다.
211
+ 기존 그래프 데이터가 있는 DB는 전환 전 `backups/*.pre-v2-write-master.*.sqlite`
212
+ 스냅샷을 한 번 생성하고, `PRAGMA user_version=4` 와 `kg_meta.db_format_version=4`
213
+ 를 기록한다. 더 높은 포맷의 DB는 fail-closed 로 열리지 않는다.
210
214
 
211
215
  ---
212
216
 
@@ -9,7 +9,7 @@
9
9
 
10
10
  | 약속 | 목표 (PPT) | 현재 (repo) | 갭 |
11
11
  |------|-----------|-------------|----|
12
- | Cross-Platform Parity | Win·macOS·Linux·iOS·Android, 같은 디자인 토큰·컴포넌트 | Web(static) + VSCode ext + Telegram (브라우저 어디서나) | 네이티브 데스크탑/모바일 셸 없음 (PWA 부분 지원) |
12
+ | Cross-Platform Parity | Win·macOS·Linux·iOS·Android, 같은 디자인 토큰·컴포넌트 | `/app` SPA + VSCode ext + Telegram (브라우저 어디서나) | 네이티브 데스크탑/모바일 셸 없음 (PWA 부분 지원) |
13
13
  | Zero-Config Auto Setup | PROBE → RECOMMEND → INSTALL → VERIFY → PRESET, 90초 내 | `LTCAI doctor` (의존성만 체크 = PROBE의 일부) | GPU/RAM 프로빙, 추천, 설치, 벤치마크, 프리셋 미구현 |
14
14
  | Everything is a Graph | 10 노드 타입 / 12 엣지 타입 / 임베딩 / 신뢰도+증거 | nodes·edges·chunks 테이블 + 한글 동사 엣지(EDGE_VERB) | 명시 enum·embedding·confidence/evidence·owner 결손 |
15
15
 
@@ -20,7 +20,7 @@
20
20
  PPT 명세는 "한 코드·다섯 화면" — Shared Core(Design Tokens, UI Components, Business Logic, AI/Graph Core) 위에서 Tauri(데스크탑) / Capacitor·RN(모바일) 렌더러가 같은 결과를 낸다.
21
21
 
22
22
  **현재 구현**
23
- - `static/chat.html`, `static/graph.html`, `static/admin.html`, `static/account.html` 4개 HTML `static/css/tokens.css` 단일 토큰을 공유 (v2.2.1)
23
+ - `static/v3/` `/app` SPA 단일 토큰과 컴포넌트를 공유하며 legacy HTML 페이지는 v4에서 삭제됨
24
24
  - `vscode-extension/` — TypeScript VSCode 통합
25
25
  - `static/manifest.json` + `static/sw.js` — PWA 부분 지원 (iOS/Android 홈 화면 추가는 됨)
26
26
  - `telegram_bot.py` — Telegram 미러
@@ -28,11 +28,11 @@ PPT 명세는 "한 코드·다섯 화면" — Shared Core(Design Tokens, UI Comp
28
28
  **갭**
29
29
  - 데스크탑 네이티브 셸 (Tauri) 미구현
30
30
  - 모바일 네이티브 (Capacitor / RN) 미구현
31
- - 다국어(i18n) 시스템화 (HTML에 한글 하드코딩)
31
+ - `/app` SPA i18n(en/ko) 런타임은 구현됨; 네이티브 데스크탑/모바일 셸은 아직 없음
32
32
 
33
33
  **보강 결과물 (완료, v2.2.1)**
34
- - `static/css/tokens.css` — 4개 HTML이 공유하는 단일 진실 토큰 (`:root` = 라이트, `[data-lt-theme="dark"]` = 다크)
35
- - `static/css/responsive.css` + `static/scripts/ux.js` — 반응형 레이아웃 / 라이트·다크 토글 + OS 감지 + 지속화
34
+ - `static/css/tokens.css` + `static/v3/css/` `/app` SPA가 공유하는 단일 진실 토큰
35
+ - `static/v3/js/core/store.js` + `shell.js` — 반응형 레이아웃 / 라이트·다크 토글 + OS 감지 + 지속화
36
36
  - 로드맵: `apps/desktop/` (Tauri 셸) · `apps/mobile/` (Capacitor 셸) 차후 단계
37
37
 
38
38
  ---
@@ -103,9 +103,9 @@ chunks ( id, source_node, text, metadata_json, created_at )
103
103
  | **PPT 명세** | `#FFFFFF` 또는 `#0B0B16` | `#6E4AE6` Lattice 보라 |
104
104
 
105
105
  **보강 결과물 (완료, v2.2.1)**
106
- - `static/css/tokens.css` — 단일 토큰을 모든 화면이 공유. `:root` 가 라이트 값,
106
+ - `static/css/tokens.css` — 단일 토큰을 `/app` 화면이 공유. `:root` 가 라이트 값,
107
107
  `[data-lt-theme="dark"]` 가 다크 값을 정의하는 단일 진실 소스
108
- - 라이트/다크 토글 + OS 다크모드 감지 + 지속화는 `static/scripts/ux.js` 가 담당
108
+ - 라이트/다크 토글 + OS 다크모드 감지 + 지속화는 `static/v3/js/core/store.js` 와 `shell.js` 가 담당
109
109
 
110
110
  ---
111
111
 
@@ -115,10 +115,10 @@ PPT 화면 1, 13 (login, security) 에 한국어 / Microsoft Entra ID / Okta SSO
115
115
 
116
116
  **현재**
117
117
  - `server.py` 의 `/auth/sso` 엔드포인트 존재 (architecture.md 언급) — Entra/Okta 둘 다 명시되어 있는지 확인 필요
118
- - 다국어 — HTML 하드코딩 (`lang="ko"`)
118
+ - 다국어 — `/app` SPA en/ko 런타임(`static/v3/js/core/i18n.js`)과 언어 선택이 구현됨
119
119
 
120
120
  **갭 / 다음 단계**
121
- - i18n 사전 (`static/i18n/{ko,en,ja}.json`) 추출 PPT 명세 그대로 토큰화
121
+ - i18n 사전 런타임은 `static/v3/js/core/i18n.js` 구현됨; 추가 언어는 사전에 확장
122
122
 
123
123
  ---
124
124
 
@@ -127,7 +127,7 @@ PPT 화면 1, 13 (login, security) 에 한국어 / Microsoft Entra ID / Okta SSO
127
127
  | 순위 | 파일 | 무엇 |
128
128
  |------|------|------|
129
129
  | 1 | `docs/kg-schema.md`, `kg_schema.py` | KG 스키마 정식화 (10 노드 · 12 엣지 · embedding · confidence) |
130
- | 2 | `static/css/tokens.css` (+ `responsive.css`, `ux.js`) | 디자인 토큰 통합 + 라이트/다크 v2.2.1 완료 |
130
+ | 2 | `static/css/tokens.css` + `static/v3/` | 디자인 토큰 통합 + 라이트/다크 + en/ko i18n |
131
131
  | 3 | `auto_setup.py` | OS 프로빙 + 모델 추천 + 설치 어댑터 |
132
132
  | 4 | `docs/architecture.md` 보강 | 위 변경 반영 |
133
133
  | 5 | (차후) `apps/desktop`, `apps/mobile` 스캐폴딩 | Tauri/Capacitor |
@@ -0,0 +1,24 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
6
+ <meta name="color-scheme" content="dark light" />
7
+ <title>Lattice AI · Digital Brain</title>
8
+ <link rel="manifest" href="/manifest.json" />
9
+ <link rel="icon" type="image/png" sizes="32x32" href="/icons/favicon-32.png" />
10
+ <script>
11
+ (function () {
12
+ try {
13
+ var theme = localStorage.getItem("lattice.theme");
14
+ if (theme === "light" || theme === "dark") document.documentElement.dataset.theme = theme;
15
+ } catch (e) {}
16
+ })();
17
+ </script>
18
+ </head>
19
+ <body>
20
+ <div id="root"></div>
21
+ <noscript>Lattice AI requires JavaScript for the local Digital Brain desktop shell.</noscript>
22
+ <script type="module" src="/src/main.tsx"></script>
23
+ </body>
24
+ </html>