ltcai 11.7.0 → 11.9.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 (136) hide show
  1. package/README.md +73 -70
  2. package/docs/BENCHMARKS.md +9 -2
  3. package/docs/CHANGELOG.md +157 -0
  4. package/docs/CI_AND_RELEASE_GATES.md +126 -41
  5. package/docs/COMMUNITY_AND_PLUGINS.md +1 -1
  6. package/docs/DEVELOPMENT.md +34 -14
  7. package/docs/LEGACY_COMPATIBILITY.md +10 -6
  8. package/docs/ONBOARDING.md +5 -3
  9. package/docs/OPERATIONS.md +5 -1
  10. package/docs/PERMISSION_MODE.md +14 -9
  11. package/docs/TRUST_MODEL.md +13 -6
  12. package/docs/USABILITY_AUDIT.md +5 -0
  13. package/docs/WHY_LATTICE.md +6 -4
  14. package/docs/kg-schema.md +7 -3
  15. package/docs/mcp-tools.md +73 -79
  16. package/docs/security-model.md +6 -3
  17. package/lattice_brain/__init__.py +1 -1
  18. package/lattice_brain/graph/_kg_common/__init__.py +1 -54
  19. package/lattice_brain/graph/_kg_common/text.py +14 -450
  20. package/lattice_brain/ingestion/__init__.py +6 -3
  21. package/lattice_brain/multimodal/__init__.py +9 -3
  22. package/latticeai/__init__.py +1 -1
  23. package/latticeai/api/agent_worker_seam.py +12 -1
  24. package/latticeai/api/models.py +18 -110
  25. package/latticeai/api/search.py +7 -30
  26. package/latticeai/api/worker_compute.py +53 -107
  27. package/latticeai/api/worker_seams.py +17 -2
  28. package/latticeai/core/http_origin.py +3 -3
  29. package/latticeai/core/messages.py +0 -5
  30. package/latticeai/core/policy.py +1 -6
  31. package/latticeai/core/quiet.py +1 -20
  32. package/latticeai/core/security.py +29 -83
  33. package/latticeai/core/sessions.py +95 -4
  34. package/latticeai/core/users.py +0 -38
  35. package/latticeai/models/router/catalog.py +2 -2
  36. package/latticeai/models/router/generation.py +81 -14
  37. package/latticeai/models/router/loading.py +41 -5
  38. package/latticeai/runtime/access_runtime.py +7 -4
  39. package/latticeai/runtime/build_phases/features.py +8 -31
  40. package/latticeai/runtime/build_phases/foundation.py +7 -16
  41. package/latticeai/runtime/build_phases/web.py +3 -3
  42. package/latticeai/runtime/build_phases/worker_profile.py +21 -28
  43. package/latticeai/runtime/runtime_context.py +0 -2
  44. package/latticeai/services/architecture_readiness.py +18 -19
  45. package/latticeai/services/process_audit.py +1 -22
  46. package/latticeai/services/product_readiness.py +33 -11
  47. package/latticeai/services/voice_capture.py +8 -28
  48. package/latticeai/tools/__init__.py +6 -46
  49. package/latticeai/tools/commands.py +9 -15
  50. package/latticeai/tools/knowledge.py +0 -6
  51. package/package.json +3 -5
  52. package/requirements.txt +0 -1
  53. package/scripts/check_current_release_docs.mjs +1 -1
  54. package/scripts/check_openapi_drift.mjs +3 -2
  55. package/scripts/check_server_i18n.mjs +5 -4
  56. package/scripts/compose_openapi.py +2 -1
  57. package/scripts/export_openapi.py +5 -4
  58. package/scripts/gen_worker_allowlist_fixture.py +2 -2
  59. package/scripts/openapi_route_families.json +14 -73
  60. package/scripts/release_screen_claims.json +131 -27
  61. package/src-tauri/Cargo.lock +11 -10
  62. package/src-tauri/Cargo.toml +1 -1
  63. package/src-tauri/tauri.conf.json +1 -1
  64. package/static/app/asset-manifest.json +41 -41
  65. package/static/app/assets/{Act-BPcVAbOL.js → Act-B4WT81kh.js} +1 -1
  66. package/static/app/assets/AdminConsole--Wf71m-o.js +1 -0
  67. package/static/app/assets/{Brain-CT92Kos0.js → Brain-CtYaa26c.js} +2 -2
  68. package/static/app/assets/BrainHome-Be2VPJEc.js +2 -0
  69. package/static/app/assets/BrainSignals-C0__xgpG.js +1 -0
  70. package/static/app/assets/Capture-DdNi5Peb.js +1 -0
  71. package/static/app/assets/Chronicle-B3hNveeI.js +1 -0
  72. package/static/app/assets/CommandPalette-CIsnSsFL.js +1 -0
  73. package/static/app/assets/Library-Bl5XClFV.js +1 -0
  74. package/static/app/assets/LivingBrain-DjkTB_gh.js +1 -0
  75. package/static/app/assets/{ProductFlow-DXBC6brE.js → ProductFlow-DCUNRNHs.js} +1 -1
  76. package/static/app/assets/{ReviewCard-HXRle3qq.js → ReviewCard-CD3yWvUB.js} +2 -2
  77. package/static/app/assets/System-BJ6jQ_SL.js +1 -0
  78. package/static/app/assets/arrow-left-6_28Z0qH.js +1 -0
  79. package/static/app/assets/{bot-Cn8bWRuq.js → bot-Bc3Q27YR.js} +1 -1
  80. package/static/app/assets/brain-B9BDrMTe.js +1 -0
  81. package/static/app/assets/{button-Ct9f2_oT.js → button-D6JcpYcf.js} +1 -1
  82. package/static/app/assets/circle-check-BFu9lD-3.js +1 -0
  83. package/static/app/assets/{circle-pause-CmzC_apg.js → circle-pause-BGMiV8UU.js} +1 -1
  84. package/static/app/assets/{circle-play-D8mW2aQ7.js → circle-play-DoanLHnd.js} +1 -1
  85. package/static/app/assets/{cpu-DZcdd0PZ.js → cpu-DwzNf82m.js} +1 -1
  86. package/static/app/assets/{download-bv1KEPGQ.js → download-Ddw49yCV.js} +1 -1
  87. package/static/app/assets/{folder-open-d-Pip5gr.js → folder-open-Brd6Kvto.js} +1 -1
  88. package/static/app/assets/{hard-drive-D20iavUb.js → hard-drive-Bu-DTJdB.js} +1 -1
  89. package/static/app/assets/index-CGdg_aq9.css +2 -0
  90. package/static/app/assets/{index-Do83hDzJ.js → index-CWKRRsLW.js} +4 -4
  91. package/static/app/assets/input-CEqsxtil.js +1 -0
  92. package/static/app/assets/{link-2-BPJOFlAy.js → link-2-DZ4OA5tJ.js} +1 -1
  93. package/static/app/assets/{permissionCopy-ChdJd493.js → permissionCopy-D9TR0F8b.js} +1 -1
  94. package/static/app/assets/primitives-DORg7Z_7.js +1 -0
  95. package/static/app/assets/search-0NQ21wXe.js +1 -0
  96. package/static/app/assets/{share-2-YNX_NtMU.js → share-2-BC5FirFv.js} +1 -1
  97. package/static/app/assets/{shield-alert-DuQ3zrVL.js → shield-alert-DUbR2W2s.js} +1 -1
  98. package/static/app/assets/textarea-jtQcRSXo.js +1 -0
  99. package/static/app/assets/{useFocusTrap-ZVI98jaW.js → useFocusTrap-HRemcWId.js} +1 -1
  100. package/static/app/assets/{useMutation-CVC4qv_D.js → useMutation-DqlFE-Bw.js} +1 -1
  101. package/static/app/assets/{useQuery-C7BeG4HU.js → useQuery-BizqBNGw.js} +1 -1
  102. package/static/app/assets/utils-WgW4V69R.js +4 -0
  103. package/static/app/assets/workspace-DSek3jCY.js +1 -0
  104. package/static/app/index.html +4 -4
  105. package/static/sw.js +1 -1
  106. package/lattice_brain/ingestion/pipeline.py +0 -108
  107. package/latticeai/api/local_files.py +0 -44
  108. package/latticeai/api/tools.py +0 -126
  109. package/latticeai/api/voice_capture.py +0 -32
  110. package/latticeai/core/agent_permission.py +0 -85
  111. package/scripts/agent_eval.py +0 -34
  112. package/scripts/brain_quality_eval.py +0 -37
  113. package/scripts/check_legacy_debt.mjs +0 -91
  114. package/scripts/check_python.py +0 -100
  115. package/scripts/chunking_parity_corpus.py +0 -449
  116. package/scripts/generate_agent_parity_fixtures.py +0 -771
  117. package/scripts/generate_chunking_parity_fixtures.py +0 -259
  118. package/static/app/assets/AdminConsole-Bw1ATQL0.js +0 -1
  119. package/static/app/assets/BrainHome-CFBkt1K_.js +0 -2
  120. package/static/app/assets/BrainSignals-ReLWF2H8.js +0 -1
  121. package/static/app/assets/Capture-BsTokYkk.js +0 -1
  122. package/static/app/assets/Chronicle-B6f0T9id.js +0 -1
  123. package/static/app/assets/CommandPalette-CuvjTv1u.js +0 -1
  124. package/static/app/assets/Library-BGJbG9Hd.js +0 -1
  125. package/static/app/assets/LivingBrain-DGYK_Jsa.js +0 -1
  126. package/static/app/assets/System-CMHSO9qM.js +0 -1
  127. package/static/app/assets/arrow-left-BfmkskWx.js +0 -1
  128. package/static/app/assets/brain-CQJberbE.js +0 -1
  129. package/static/app/assets/circle-check-DruOxB-4.js +0 -1
  130. package/static/app/assets/index-D9x-kSNy.css +0 -2
  131. package/static/app/assets/input-BLXVNmj1.js +0 -1
  132. package/static/app/assets/primitives-Cv5tbZBY.js +0 -1
  133. package/static/app/assets/search-CT9aho2j.js +0 -1
  134. package/static/app/assets/textarea-DqwLnli4.js +0 -1
  135. package/static/app/assets/utils-CiFtIdZq.js +0 -4
  136. package/static/app/assets/workspace-DQz9vIId.js +0 -1
@@ -3,7 +3,7 @@
3
3
  > **Status: canonical** — current contributor guidance, kept in sync with the
4
4
  > current release.
5
5
 
6
- Current release: **11.7.0 — Clean Sweep**.
6
+ Current release: **11.9.0 — Working Order**.
7
7
 
8
8
  This document is for contributors working on the local-first Digital Brain
9
9
  codebase. Product positioning and quick start stay in `README.md`; supported
@@ -32,15 +32,20 @@ Engineering work should preserve these boundaries:
32
32
 
33
33
  ```bash
34
34
  npm install
35
- npm run dev
35
+ npm start
36
36
  ```
37
37
 
38
- The local app is served through the FastAPI sidecar at:
38
+ `npm start` (or `bin/ltcai.js` / the `LTCAI` binary) is the product: it
39
+ boots `lattice-host` and serves the SPA at:
39
40
 
40
41
  ```text
41
42
  http://127.0.0.1:4825/app
42
43
  ```
43
44
 
45
+ `npm run dev` is **not** the product. It starts the 19-route Python AI
46
+ worker with `--reload` (`latticeai.cli.entrypoint`). Use it when iterating
47
+ on worker compute seams, not to serve the app.
48
+
44
49
  Apple Silicon local model extras:
45
50
 
46
51
  ```bash
@@ -53,7 +58,6 @@ Run the smallest affected gate while iterating. Before committing broad runtime,
53
58
  API, UI, or release work, run:
54
59
 
55
60
  ```bash
56
- npm run check:python
57
61
  npm run lint
58
62
  npm run typecheck
59
63
  npm run test:frontend
@@ -61,9 +65,21 @@ npm run test:unit
61
65
  npm run docs:check-links
62
66
  ```
63
67
 
64
- `npm run lint` runs the Python Ruff baseline, frontend TypeScript lint gate,
65
- visual smoke syntax checks, an exact generated-OpenAPI drift check, i18n literal
66
- checks, and browser-extension syntax/behavior tests.
68
+ `npm run lint` is **ten** gates since 11.8.0, in order: `lint:python`
69
+ (ruff + mypy), `lint:visual`, `lint:frontend`, `frontend:openapi:check`,
70
+ `check_i18n_literals.mjs`, `check:i18n-namespaces`, `check:bundle`,
71
+ `check:server-i18n`, `check_release_evidence_bound.mjs`, and
72
+ `check:max-file-lines`. Three left in 11.8.0: `check:python` (ruff already
73
+ parses every file on every CI test leg), `check:legacy-debt` (the mjs mirror had
74
+ drifted from the Python test that states the same rule — the Python test is
75
+ authoritative), and the extension tests, which CI now invokes directly on the
76
+ 3.11 + ubuntu leg.
77
+
78
+ Coverage floors are not symmetrical, and the difference is deliberate rather
79
+ than an oversight: **Python is a line-coverage floor of 90**
80
+ (`[tool.coverage.report] fail_under = 90`, branch measurement off) and the
81
+ frontend still pins **100% on all four vitest metrics**. Run
82
+ `npm run test:coverage` / `npm run test:frontend:coverage` to see either.
67
83
 
68
84
  Use these when the change touches the relevant surface:
69
85
 
@@ -140,7 +156,8 @@ pre-tool/post-tool lifecycle:
140
156
 
141
157
  - browser `read-url` ingestion dispatches `tool.kg_ingest.*` events;
142
158
  - browser `ingest-current-tab` ingestion dispatches the same lifecycle;
143
- - `IngestionPipeline` remains the common ingestion boundary behind those routes.
159
+ - the native ingest door in `lattice-ingest` (writing through `graph_write`)
160
+ remains the single ingestion boundary behind those routes.
144
161
 
145
162
  ## Documentation Sync
146
163
 
@@ -158,10 +175,13 @@ For user-facing, API, runtime, release, or packaging changes, check:
158
175
  Release/publish examples must use exact target-version filenames. Do not
159
176
  document wildcard artifact upload commands.
160
177
 
161
- For 9.9.0 release work, exact artifacts are:
178
+ For 11.9.0 release work, exact artifacts are:
179
+
180
+ - `dist/ltcai-11.9.0-py3-none-any.whl`
181
+ - `dist/ltcai-11.9.0.tar.gz`
182
+ - `ltcai-11.9.0.tgz`
183
+ - `dist/ltcai-11.9.0.vsix`
184
+ - `src-tauri/target/release/bundle/dmg/Lattice AI_11.9.0_aarch64.dmg`
162
185
 
163
- - `dist/ltcai-9.9.0-py3-none-any.whl`
164
- - `dist/ltcai-9.9.0.tar.gz`
165
- - `ltcai-9.9.0.tgz`
166
- - `dist/ltcai-9.9.0.vsix`
167
- - `src-tauri/target/release/bundle/dmg/Lattice AI_9.9.0_aarch64.dmg`
186
+ The dmg is ad-hoc signed (effectively unsigned); `npm run release:validate`
187
+ checks the names and presence, not a Developer ID signature.
@@ -26,14 +26,18 @@ Removed layers stay listed in `legacy_compatibility.REMOVED_SHIMS` and in the
26
26
 
27
27
  ## Legacy Debt Gate
28
28
 
29
- Two gates keep the debt paid down:
29
+ **One** gate keeps the debt paid down:
30
30
 
31
- - `scripts/check_legacy_debt.mjs` (part of `npm run lint`) — fails if a
32
- disallowed root-level Python module reappears, or if any source tree imports
33
- a removed root shim.
34
31
  - `tests/unit/test_legacy_root_shims.py` — asserts removed shims stay
35
- unimportable, canonical replacements import, and the registry in
36
- `latticeai.core.legacy_compatibility` matches reality.
32
+ unimportable and canonical replacements import.
33
+
34
+ There used to be two. `scripts/check_legacy_debt.mjs` stated the same rule in
35
+ JavaScript as part of `npm run lint`, and by 11.8.0 the two implementations had
36
+ drifted apart — at which point having both was worse than having one, because
37
+ neither could be trusted as the answer. The Python test is authoritative and the
38
+ mjs mirror was deleted. `latticeai.core.legacy_compatibility` went with the
39
+ platform code in 11.6.0; the registry it held described modules that no longer
40
+ exist to shim.
37
41
 
38
42
  ## Root Module Map (removed in 9.9.1)
39
43
 
@@ -1,6 +1,6 @@
1
1
  # Lattice AI Onboarding
2
2
 
3
- Current release: **11.7.0 — Clean Sweep**.
3
+ Current release: **11.9.0 — Working Order**.
4
4
 
5
5
  The first-run goal is a five-minute path from "I opened the app" to "my Brain
6
6
  has a source, a question, and proof." This page is the product contract behind
@@ -10,8 +10,10 @@ read the docs first.
10
10
  ## Five-Minute Flow
11
11
 
12
12
  1. Wake the Brain and confirm the local owner profile.
13
- 2. Let Lattice inspect local model/runtime readiness.
14
- 3. Pick the recommended Brain voice or skip model loading.
13
+ 2. Let Lattice inspect local model/runtime readiness (`/setup/scan` is a
14
+ real probe; brew/pip items stay manual).
15
+ 3. Pick the recommended Brain voice (`/models/recommendations` probes RAM
16
+ and the worker catalog) or skip model loading.
15
17
  4. Add one source: upload a file, choose and scan a folder, save a note, or
16
18
  capture a browser/source event.
17
19
  5. Ask one grounded question and inspect the answer proof.
@@ -1,4 +1,4 @@
1
- # Lattice AI — Operations Guide (v11.7.0)
1
+ # Lattice AI — Operations Guide (v11.9.0)
2
2
 
3
3
  > **Status: canonical** — kept in sync with the current release. Storage layout
4
4
  > below reflects the SQLite live Brain store and workspace scoping, not the
@@ -29,6 +29,10 @@ tar -czf ltcai-backup-$(date +%Y%m%d).tar.gz ~/.ltcai ~/ltcai-agent
29
29
  tar -xzf ltcai-backup-YYYYMMDD.tar.gz -C ~
30
30
  ```
31
31
 
32
+ 인앱 복원(`.latticebrain` / `VACUUM INTO` 스냅샷)은 원자적입니다. **오래
33
+ 떠 있는 프로세스에서 복원하면 커넥션이 재활용되기 전까지 복원 전
34
+ 바이트를 줄 수 있습니다.** 복원 뒤에는 호스트를 재시작하십시오.
35
+
32
36
  ### 2.3 히스토리만 초기화
33
37
  ```bash
34
38
  rm ~/.ltcai/history.json
@@ -97,18 +97,23 @@ before routers are mounted would otherwise pin the store to the fallback
97
97
 
98
98
  ## Code map
99
99
 
100
+ The dial is native. v11.6.0 moved the agent loop into `lattice-agent` and the
101
+ routes into `lattice-platform`; v11.8.0 deleted the last Python module that
102
+ still carried a copy of the gate helpers (`latticeai/core/agent_permission.py`,
103
+ whose only readers were already ported).
104
+
100
105
  | Module | Role |
101
106
  |--------|------|
102
- | `latticeai/core/permission_mode.py` | Pure decision table |
103
- | `latticeai/core/agent_permission.py` | Agent plan/tool gate helpers |
104
- | `latticeai/core/agent/` | `SingleAgentRuntime` gates (mode-aware in-line: `planning.py` for the plan gate, `execution.py` for the per-tool gates) |
107
+ | `rust/lattice-agent/src/mode.rs` | Pure decision table (port of `latticeai.core.permission_mode`) |
108
+ | `rust/lattice-agent/src/permission.rs` | Plan/tool gate helpers — the ordered block-reason chain |
109
+ | `rust/lattice-agent/src/breaker.rs` | Mode-invariant circuit breakers |
110
+ | `rust/lattice-agent/src/agentloop/gates.rs` | The gates one executor step passes, in the order that decides it |
111
+ | `rust/lattice-agent/src/agentloop/planning.rs` | The plan gate |
112
+ | `rust/lattice-platform/src/permission_mode.rs` | HTTP routes + persistence (`permission_mode.json`, atomic replace) |
113
+ | `rust/lattice-auth/src/policy.rs` | The tool policy table the gates read |
105
114
  | `frontend/src/components/PermissionModePanel.tsx` | Settings selector |
106
- | `latticeai/services/permission_mode_service.py` | Persistence |
107
- | `latticeai/runtime/permission_mode_wiring.py` | Process-wide service + router mount |
108
- | `latticeai/runtime/chat_wiring.py` | Agent runtime injection |
109
- | `latticeai/runtime/router_registration.py` | HTTP mount |
110
- | `latticeai/services/tool_dispatch.py` | `enforce_policy` + `build_agent_runtime` |
111
- | `latticeai/api/permission_mode.py` | HTTP routes |
115
+ | `frontend/src/lib/permissionCopy.ts` | The plain-language wording for each mode |
116
+ | `latticeai/core/permission_mode.py` | The worker's own `is_circuit_breaker`, asked by `POST /agent/tool` — the mode-invariant refusal holds on the executing side too, not only at the gate that dispatched |
112
117
 
113
118
  ## AGENTS.md note
114
119
 
@@ -1,6 +1,6 @@
1
1
  # Lattice AI Trust Model
2
2
 
3
- Current release: **11.7.0 — Clean Sweep**.
3
+ Current release: **11.9.0 — Working Order**.
4
4
 
5
5
  Lattice AI is local-first, explicit about external communication, and honest
6
6
  when a capability is unavailable.
@@ -24,10 +24,14 @@ Local data can include:
24
24
 
25
25
  External communication requires configuration plus a user/admin action:
26
26
 
27
- - cloud model calls after keys are configured and a cloud model is selected;
27
+ - cloud model calls after credentials resolve (`cloud_provider.json` / env
28
+ key / locally OAuth-authenticated `agy` or `grok`) and the escalation
29
+ policy — or an explicit `/cloud` prefix — uses them. Every such turn
30
+ writes a shape-only egress audit (provider / model / reason, never
31
+ content) and stages extracted knowledge as a Review Center proposal;
28
32
  - model downloads from registries after install consent;
29
- - Telegram bridge after the integration is enabled, the chat is allowlisted,
30
- and a dedicated server session bearer is configured;
33
+ - Telegram bridge — removed in 11.6.0 with the platform code that became
34
+ the AI worker; nothing replaces it;
31
35
  - Brain Network peer actions after pairing;
32
36
  - Docker/Postgres setup after opt-in scale configuration;
33
37
  - update checks only when enabled;
@@ -51,7 +55,7 @@ Lattice AI should fail closed or show an unavailable state for:
51
55
  - no graph/context evidence available;
52
56
  - unavailable external integration;
53
57
  - unknown or unreadable Knowledge Graph workspace scope;
54
- - missing Telegram chat allowlist or dedicated server session token;
58
+ - Telegram inbound (the bridge was removed in 11.6.0; nothing replaces it);
55
59
  - wrong archive passphrase;
56
60
  - archive tampering, unsupported archive versions, or path traversal.
57
61
 
@@ -67,7 +71,10 @@ does not mean secrets should appear in clear text.
67
71
  - Local files are only as protected as the user's machine, OS account, backups,
68
72
  and disk encryption.
69
73
  - Cloud model prompts follow the selected provider's policy once the user
70
- explicitly chooses that provider.
74
+ explicitly chooses that provider (or the `auto`/`always` escalation
75
+ policy does, behind `cloud_allowed`). The `api_key` path is
76
+ mock-verified only in this release; live OAuth used `cli_oauth` at
77
+ zero billing. Extracted cloud knowledge is proposal-first.
71
78
  - A local admin can inspect local files and process memory outside Lattice AI.
72
79
  - Marketplace and model registries are third-party services when explicitly
73
80
  contacted.
@@ -86,6 +86,11 @@ Heuristics:
86
86
 
87
87
  ## Journey 4 — Brain hierarchy
88
88
 
89
+ > **Dated snapshot (2026-07-21).** `DepthEmergence.tsx` was deleted in v11.8.0
90
+ > when the Brain home was redesigned; the depth-tiered reveal it describes is no
91
+ > longer how the home discloses structure. The findings below are kept as the
92
+ > record of what was evaluated at the time, not as current-truth surface notes.
93
+
89
94
  Surface: `frontend/src/features/brain/DepthEmergence.tsx`,
90
95
  `.../BrainMemoryLayer.tsx`.
91
96
 
@@ -1,6 +1,6 @@
1
1
  # Why Lattice AI Exists
2
2
 
3
- Current release: **11.7.0 — Clean Sweep**.
3
+ Current release: **11.9.0 — Working Order**.
4
4
 
5
5
  **Lattice AI is a local-first Digital Brain that keeps your knowledge durable
6
6
  across any AI model.**
@@ -25,8 +25,9 @@ material. That breaks down for real work:
25
25
  ## The Lattice Answer
26
26
 
27
27
  Lattice AI keeps conversations, documents, memories, decisions, relationships,
28
- and source provenance in a private local Brain. Models can be local, cloud,
29
- current, or future. The Brain remains.
28
+ and source provenance in a private local Brain. Models can be local, or an
29
+ optional cloud worker you hire (OAuth CLI or an API key). Default is local.
30
+ The Brain remains.
30
31
 
31
32
  The graph matters as visible proof, but a graph editor is not the product
32
33
  identity. The product identity is a local-first Digital Brain: the user talks or
@@ -48,7 +49,8 @@ secondary.
48
49
  - Ask what the team decided and see the source.
49
50
  - Add documents and build a searchable private memory.
50
51
  - Prepare from old notes, project decisions, and files.
51
- - Preserve context when moving between models.
52
+ - Preserve context when moving between models. Cloud is optional; default
53
+ is local.
52
54
  - Export or restore the Brain as an encrypted `.latticebrain` archive.
53
55
  - Use Korean or English without changing the underlying Brain.
54
56
  - Avoid fake answers when no model or evidence is available.
package/docs/kg-schema.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Knowledge Graph Schema
2
2
 
3
- Current release: **11.7.0 — Clean Sweep**.
3
+ Current release: **11.9.0 — Working Order**.
4
4
 
5
5
  명세 출처: `lattice_ai_full_spec.pptx` 슬라이드 20·21·22
6
6
  구현: `lattice_brain/graph/schema.py`
@@ -142,8 +142,12 @@ provenance(source_type, source_uri, content_hash, captured_at, modified_at,
142
142
  범위 없는 로컬 폴더는 개인 Brain으로 재투영하되 기존 노드 ID는 보존하며,
143
143
  같은 폴더를 다른 워크스페이스로 조용히 재할당하지 않는다.
144
144
 
145
- 구현: `lattice_brain/ingestion/` (`IngestionPipeline`) 가 단일 진입점이며,
146
- 파일/로컬폴더/URL/브라우저 탭/텍스트를 모두 이 형태로 정규화한다.
145
+ 구현: 단일 진입점은 v11.6.0부터 Rust의 네이티브 ingest 문
146
+ (`lattice-ingest` → `lattice_core::graph_write`)이며, 파일/로컬폴더/URL/
147
+ 브라우저 탭/텍스트를 모두 이 형태로 정규화한다. `lattice_brain/ingestion/`은
148
+ 양쪽이 공유하는 어휘 — 라우팅 상수, DTO, 콘텐츠 해시, 추출 품질 점수 — 만
149
+ 남았고, v11.8.0이 마지막 잔재였던 `IngestionPipeline` 능력 프로브 클래스를
150
+ 그 유일한 호출 라우트와 함께 삭제했다.
147
151
 
148
152
  ---
149
153
 
package/docs/mcp-tools.md CHANGED
@@ -4,7 +4,11 @@ Lattice AI는 MCP(Model Context Protocol) 서버로 동작하여 Claude Desktop,
4
4
 
5
5
  ## 연결 설정
6
6
 
7
- `claude_desktop_config.json` 또는 Cursor MCP 설정:
7
+ The MCP surface is **streamable HTTP JSON-RPC** at `POST /mcp` on the
8
+ loopback gateway (default `http://localhost:4825`). There is no separate
9
+ stdio or SSE transport.
10
+
11
+ `claude_desktop_config.json` or Cursor MCP settings:
8
12
 
9
13
  ```json
10
14
  {
@@ -16,112 +20,102 @@ Lattice AI는 MCP(Model Context Protocol) 서버로 동작하여 Claude Desktop,
16
20
  }
17
21
  ```
18
22
 
19
- ## 도구 목록
20
-
21
- ### 파일 시스템
23
+ Auth is the same session gate as every other product route:
22
24
 
23
- | 도구 | 설명 | 위험도 |
24
- |------|------|--------|
25
- | `read_file` | 파일 읽기 (라인 번호, offset/limit 지원) | 낮음 |
26
- | `edit_file` | 정밀 diff 편집 (`old_string` 유일성 검증) | 중간 |
27
- | `list_dir` | 디렉토리 목록 | 낮음 |
28
- | `grep` | 정규식 검색, glob 필터, context_lines | 낮음 |
25
+ - Loopback install with authentication off → the anonymous local owner (this
26
+ is what a localhost client such as Claude Desktop uses).
27
+ - Authentication on → send the `session_token` cookie or
28
+ `Authorization: Bearer <token>`.
29
29
 
30
- ### 실행
30
+ Supported JSON-RPC methods: `initialize`, `notifications/initialized`,
31
+ `tools/list`, `tools/call`. Unknown methods return `-32601`. Notifications
32
+ have no result body (`202`).
31
33
 
32
- | 도구 | 설명 | 위험도 |
33
- |------|------|--------|
34
- | `run_command` | shell 없이 고정 read-only 명령 allowlist 실행 | 높음 |
35
- | `run_terminal_command` | 터미널 명령 (별칭) | 높음 |
34
+ Every native tool call goes through the existing tool governor. A governance
35
+ refusal is a JSON-RPC error (`-32001`), not a successful tool result.
36
36
 
37
- ### 작업 관리
37
+ ## 도구 목록
38
38
 
39
- | 도구 | 설명 | 위험도 |
40
- |------|------|--------|
41
- | `todo_write` | TODO 항목 생성/업데이트 | 낮음 |
42
- | `todo_read` | TODO 목록 조회 | 낮음 |
39
+ MCP exposes a **curated, read-oriented** subset of Lattice native tools,
40
+ plus each installed skill as a prompt asset. Writes, shell, desktop control,
41
+ and remote-install tools are **not** on this surface — use the REST `/tools/*`
42
+ routes (with their own approval gates) for those.
43
43
 
44
- ### 시스템
44
+ ### Native (governed)
45
45
 
46
46
  | 도구 | 설명 | 위험도 |
47
47
  |------|------|--------|
48
- | `computer_screenshot` | 화면 캡처 (desktop-control capability 및 정책 승인 필요) | 높음 |
49
- | `computer_status` | 데스크톱 제어 상태 조회 (동일 capability/policy 적용) | 중간 |
50
- | `computer_open_app` | 앱 실행 | 중간 |
51
- | `computer_open_url` | URL 열기 | 낮음 |
52
- | `network_status` | IP, Wi-Fi 정보 (인증 및 ToolRegistry 정책 적용) | 중간 |
48
+ | `list_dir` | 워크스페이스 디렉터리 목록 (sandbox) | 낮음 |
49
+ | `read_file` | 워크스페이스 UTF-8 파일 읽기 (offset/limit) | 낮음 |
50
+ | `workspace_tree` | 재귀 트리 (깊이 제한) | 낮음 |
51
+ | `grep` | 워크스페이스 정규식 검색 | 낮음 |
52
+ | `knowledge_search` | 지식 정원 검색 (workspace scope, 승인 정책 적용) | 낮음 |
53
+ | `knowledge_tree` | 지식 정원 파일 목록 (동일 정책) | 낮음 |
54
+ | `git_status` | 워크스페이스 안 read-only `git status` | 낮음 |
53
55
 
54
- ### 문서
56
+ ### Skills (prompt assets)
55
57
 
56
- | 도구 | 설명 | 위험도 |
57
- |------|------|--------|
58
- | `pdf_to_text` | PDF → 텍스트 변환 | 낮음 |
59
- | `pdf_pages` | PDF 페이지 수 조회 | 낮음 |
60
- | `read_docx` | Word 문서 읽기 | 낮음 |
61
- | `read_xlsx` | Excel 파일 읽기 | 낮음 |
62
- | `read_pptx` | PowerPoint 읽기 | 낮음 |
58
+ Installed skills from the skills directory appear as `skill.<name>`
59
+ (for example `skill.code_review`). `tools/list` serves the parsed
60
+ `schema.json` input schema. `tools/call` returns the `SKILL.md` body plus
61
+ the input echo — skills are not executables.
63
62
 
64
- ### 지식 정원 (P-Reinforce)
63
+ Typical names when the repo `skills/` tree is installed:
65
64
 
66
- | 도구 | 설명 | 위험도 |
67
- |------|------|--------|
68
- | `garden_save` | 지식 정원에 저장 | 낮음 |
69
- | `garden_tree` | 지식 트리 조회 | 낮음 |
70
- | `garden_read` | 정원 파일 읽기 | 낮음 |
65
+ - `skill.code_review`
66
+ - `skill.data_analysis`
67
+ - `skill.file_edit`
68
+ - `skill.meeting_notes`
69
+ - `skill.summarize_document`
70
+ - `skill.web_search`
71
+ - `skill.weekly_review`
71
72
 
72
- ## REST API 직접 호출
73
+ ## REST API
73
74
 
74
- MCP 대신 REST API로도 동일한 도구를 호출할 수 있습니다:
75
+ The same governed subset is also reachable at `POST /mcp/call`
76
+ (`{"action": "...", "args": {}}`) and the existing `/tools/*` routes.
75
77
 
76
78
  ```bash
77
- # read_file
78
- curl -b "session=<token>" \
79
- "http://localhost:4825/tools/read_file?path=server.py"
79
+ # MCP JSON-RPC initialize
80
+ curl -s -X POST http://localhost:4825/mcp \
81
+ -H "Content-Type: application/json" \
82
+ -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"curl","version":"0"}}}'
80
83
 
81
- # edit_file
82
- curl -b "session=<token>" -X POST \
83
- http://localhost:4825/tools/edit_file \
84
+ # MCP tools/call
85
+ curl -s -b "session_token=<token>" -X POST http://localhost:4825/mcp \
84
86
  -H "Content-Type: application/json" \
85
- -d '{"path": "server.py", "old_string": "old code", "new_string": "new code"}'
87
+ -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"list_dir","arguments":{"path":"."}}}'
86
88
 
87
- # grep
88
- curl -b "session=<token>" \
89
- "http://localhost:4825/tools/grep?pattern=def%20main&glob=*.py"
89
+ # REST sibling (same dispatch)
90
+ curl -s -b "session_token=<token>" -X POST http://localhost:4825/mcp/call \
91
+ -H "Content-Type: application/json" \
92
+ -d '{"action":"list_dir","args":{"path":"."}}'
90
93
 
91
- # run_command
92
- curl -b "session=<token>" -X POST \
93
- http://localhost:4825/tools/run_command \
94
+ # Full write/exec surface (not on MCP)
95
+ curl -s -b "session_token=<token>" -X POST http://localhost:4825/tools/edit_file \
94
96
  -H "Content-Type: application/json" \
95
- -d '{"command": "rg TODO ."}'
97
+ -d '{"path": "server.py", "old_string": "old code", "new_string": "new code"}'
96
98
  ```
97
99
 
98
- `run_command`는 `pwd`, `ls`, `find`, `cat`, `head`, `tail`, `wc`, `rg`만 허용합니다.
99
- Python/Node/npm/npx/sed, shell operator, 실행 파일 경로, 절대 경로, `..` traversal,
100
- workspace 밖 symlink, `rg --pre`, `find -exec/-delete`는 거부됩니다. 빌드와 테스트는
101
- 별도의 허용된 project-script 도구를 사용합니다.
100
+ `run_command` remains a REST-only admin tool. It allows `pwd`, `ls`, `find`,
101
+ `cat`, `head`, `tail`, `wc`, `rg` only. Python/Node/npm/npx/sed, shell
102
+ operators, executable paths, absolute paths, `..` traversal, workspace-outside
103
+ symlinks, `rg --pre`, and `find -exec/-delete` are refused.
102
104
 
103
105
  ## 도구 카탈로그 조회
104
106
 
105
107
  ```bash
106
- curl -b "session=<token>" http://localhost:4825/mcp/tools
108
+ curl -b "session_token=<token>" http://localhost:4825/mcp/tools
107
109
  ```
108
110
 
109
- 응답:
110
- ```json
111
- {
112
- "tools": [
113
- {
114
- "name": "edit_file",
115
- "description": "정밀 diff 편집. old_string이 파일에 유일해야만 성공.",
116
- "risk": "medium",
117
- "parameters": { ... }
118
- },
119
- ...
120
- ]
121
- }
122
- ```
111
+ `GET /mcp/tools` lists Lattice's native tool catalog (names, descriptions,
112
+ governance). `tools/list` on `POST /mcp` is the MCP-shaped list with JSON
113
+ Schemas for the curated subset plus skills.
114
+
115
+ `POST /mcp/install` enables a skill or plugin Lattice can actually flip in
116
+ the workspace registry. Remote npm/pip/connector entries return
117
+ `{"status":"manual_required", ...}` instead of a blank 404.
123
118
 
124
- 도구 카탈로그는 인증이 필요하며 서버의 절대 `AGENT_ROOT`를 반환하지 않습니다.
125
- MCP/plugin dispatch도 각 도구의 사용자·workspace·capability·승인 정책을 우회할
126
- 수 없습니다. knowledge/Obsidian 계열 읽기는 명시적 사용자 동의와 scope를
127
- 사용합니다.
119
+ The catalogs require authentication and do not return the absolute
120
+ `AGENT_ROOT`. MCP/plugin dispatch cannot bypass user, workspace, capability,
121
+ or approval policy. Knowledge-garden reads use explicit user/workspace scope.
@@ -88,9 +88,12 @@ MAGIC_NUMBERS = {
88
88
 
89
89
  ## 수집 & 그래프 포터빌리티 보안 (v3.6.0)
90
90
 
91
- - **수집 라이프사이클**: 모든 수집은 `IngestionPipeline.ingest` → `dispatch_tool`
92
- 를 거쳐 `pre_tool`/`post_tool` 훅이 발화됩니다. `pre_tool`이 차단하면 수집은
93
- 정직하게 `status="blocked"`로 거부됩니다(권한 게이트·민감정보 가드 적용).
91
+ - **수집 라이프사이클**: 모든 수집은 네이티브 ingest 문(`lattice-ingest` →
92
+ `lattice_core::graph_write`) → 도구 디스패치를 거쳐 `pre_tool`/`post_tool`
93
+ 훅이 발화됩니다. `pre_tool`이 차단하면 수집은 정직하게 `status="blocked"`로
94
+ 거부됩니다(권한 게이트·민감정보 가드 적용). v3.6.0에 이 계약을 세운 것은
95
+ Python `IngestionPipeline.ingest`였고, v11.6.0이 문을 Rust로 옮기면서 계약은
96
+ 그대로 유지했습니다.
94
97
  - **웹 URL 읽기**(`/api/browser/read-url`): `http(s)`만 허용하고 DNS의 모든 결과에서
95
98
  loopback/private/link-local/multicast/reserved 주소를 거부합니다. 검증한 IP에 연결을
96
99
  고정해 DNS rebinding을 막고, redirect마다 재검증하며 환경 proxy를 사용하지
@@ -31,7 +31,7 @@ from .multimodal import (
31
31
  transcribe_audio,
32
32
  )
33
33
 
34
- __version__ = "11.7.0"
34
+ __version__ = "11.9.0"
35
35
 
36
36
  __all__ = [
37
37
  "AudioFacts",
@@ -119,35 +119,7 @@ from .relations import ( # noqa: E402
119
119
  _infer_edge,
120
120
  infer_edge_relation,
121
121
  )
122
- from .text import ( # noqa: E402
123
- _CHUNK_STRATEGIES,
124
- _CODE_BLANK_RUN_RE,
125
- _CODE_BOUNDARY_LINE_RE,
126
- _CODE_CHUNK_EXTENSIONS,
127
- _MARKDOWN_CHUNK_EXTENSIONS,
128
- _MARKDOWN_HEADING_RE,
129
- _MARKDOWN_MIN_SECTION_CHARS,
130
- _PROSE_CHUNK_EXTENSIONS,
131
- _PROSE_MIN_SPAN_RATIO,
132
- _PROSE_STRONG_BOUNDARY_RE,
133
- _PROSE_WEAK_BOUNDARY_RE,
134
- _chunks,
135
- _clean_text,
136
- _code_chunks,
137
- _code_segment_spans,
138
- _last_boundary,
139
- _markdown_chunks,
140
- _markdown_section_spans,
141
- _merge_small_sections,
142
- _plain_windows,
143
- _prose_chunks,
144
- chunk_strategy_for,
145
- citation_locator,
146
- page_for_offset,
147
- pdf_page_offsets,
148
- typed_chunk_meta_fields,
149
- typed_chunks,
150
- )
122
+ from .text import _chunks, _clean_text # noqa: E402
151
123
 
152
124
  # Static export list. This used to be `[name for name in globals() if not
153
125
  # name.startswith("__")]`, which is invisible to a type checker: every
@@ -187,30 +159,17 @@ __all__ = [
187
159
  "Tuple",
188
160
  "VERB_EDGE_WEIGHT",
189
161
  "WINDOWS_EXCLUDED_NAMES",
190
- "_CHUNK_STRATEGIES",
191
- "_CODE_BLANK_RUN_RE",
192
- "_CODE_BOUNDARY_LINE_RE",
193
- "_CODE_CHUNK_EXTENSIONS",
194
162
  "_CONCEPT_STOP",
195
163
  "_KG_DB_FORMAT_KEY",
196
164
  "_KG_DB_FORMAT_VERSION",
197
165
  "_LLM_EXTRACT_CONCEPT_PROMPT",
198
166
  "_LLM_EXTRACT_TRIPLE_PROMPT",
199
- "_MARKDOWN_CHUNK_EXTENSIONS",
200
- "_MARKDOWN_HEADING_RE",
201
- "_MARKDOWN_MIN_SECTION_CHARS",
202
167
  "_NOT_PERSON_WORDS",
203
168
  "_PROJECTION_VERSION",
204
- "_PROSE_CHUNK_EXTENSIONS",
205
- "_PROSE_MIN_SPAN_RATIO",
206
- "_PROSE_STRONG_BOUNDARY_RE",
207
- "_PROSE_WEAK_BOUNDARY_RE",
208
169
  "_V2_WRITE_MASTER_KEY",
209
170
  "_chunks",
210
171
  "_classify_node_type",
211
172
  "_clean_text",
212
- "_code_chunks",
213
- "_code_segment_spans",
214
173
  "_current_os_type",
215
174
  "_drive_id_for_path",
216
175
  "_excluded_directory_reason",
@@ -223,20 +182,14 @@ __all__ = [
223
182
  "_is_hidden_path",
224
183
  "_is_relative_to",
225
184
  "_json",
226
- "_last_boundary",
227
185
  "_llm_extract_concepts",
228
186
  "_llm_extract_triples",
229
- "_markdown_chunks",
230
- "_markdown_section_spans",
231
- "_merge_small_sections",
232
187
  "_node_type_for_category",
233
188
  "_now",
234
189
  "_parse_iso",
235
190
  "_parser_type_for_category",
236
191
  "_path_fingerprint",
237
192
  "_path_parts_lower",
238
- "_plain_windows",
239
- "_prose_chunks",
240
193
  "_recency_score",
241
194
  "_root_warning",
242
195
  "_safe_iso_from_stat_mtime",
@@ -250,8 +203,6 @@ __all__ = [
250
203
  "_slug",
251
204
  "_topic_candidates",
252
205
  "asyncio",
253
- "chunk_strategy_for",
254
- "citation_locator",
255
206
  "contextmanager",
256
207
  "datetime",
257
208
  "get_llm_router",
@@ -261,8 +212,6 @@ __all__ = [
261
212
  "logging",
262
213
  "math",
263
214
  "os",
264
- "page_for_offset",
265
- "pdf_page_offsets",
266
215
  "platform",
267
216
  "quiet",
268
217
  "re",
@@ -270,7 +219,5 @@ __all__ = [
270
219
  "shutil",
271
220
  "sqlite3",
272
221
  "time",
273
- "typed_chunk_meta_fields",
274
- "typed_chunks",
275
222
  "zipfile",
276
223
  ]