ltcai 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -21,15 +21,55 @@
21
21
 
22
22
  ---
23
23
 
24
+ ## What's new in 0.3.2
25
+
26
+ - **Consistent "current model"** — model-card click → prepare/load → smoke test →
27
+ `current` update → chat-readiness flows through one path in the web UI, so the
28
+ model you see is always the model chat uses.
29
+ - **3-way smoke status** — load-time chat probe now reports `ok` / `degraded` /
30
+ `failed` (special-token leakage, runaway repetition, over-long output), and the
31
+ UI shows a compatibility warning for `degraded` while still allowing chat.
32
+ - **Timezone-correct security dashboard** — "events today" now uses the same
33
+ timezone as audit timestamps (configurable via `LATTICE_TZ`, e.g. `Asia/Seoul`),
34
+ fixing off-by-one day counts.
35
+ - **Cleaner auto-graph** — Korean particle stripping, generic-word / file-extension
36
+ blacklists, and a single-source penalty so only concepts repeated across multiple
37
+ sources get promoted to nodes.
38
+ - **Honest docs** — toned down unverifiable claims (telemetry, skill/plugin counts).
39
+
40
+ ## What's new in 0.3.1
41
+
42
+ - **Reliable model selection** — `ModelResolution` unifies recommended card ID,
43
+ download ID, load ID, router cache key, and the front-end `current` so
44
+ "downloaded but not loaded" / "loaded but UI shows a different model"
45
+ classes of bugs are gone.
46
+ - **Smoke test on load** — every local model load runs a one-shot Korean
47
+ chat probe and surfaces `ready_to_chat` / `compatibility_status` to the UI.
48
+ - **Model Compatibility Layer** — per-family profiles (GPT-OSS, Gemma, Qwen,
49
+ Llama, Mistral, Phi, Deepseek …) with cached stop tokens, postprocess
50
+ rules, and Fast / Slow / Recovery paths so chat speed stays the same.
51
+ - **Auto graph curator** — topic extraction → alias clustering → promotion
52
+ with secret/PII firewall, so the graph builds itself without the user
53
+ managing nodes.
54
+ - **AI Security & Audit Command Center** — admin dashboard now shows
55
+ per-user risk matrix (compliant chats vs risky chats vs compliant files
56
+ vs risky files), sensitive-type donut, drill-down, raw explorer, and
57
+ JSON / CSV / XLSX / PDF exports — with hard-secret redaction
58
+ enforced on every response.
59
+
60
+ See [docs/CHANGELOG.md](./docs/CHANGELOG.md) for the full list.
61
+
62
+ ---
63
+
24
64
  ## Why Lattice AI?
25
65
 
26
66
  Most AI tools forget everything after each conversation. Your files sit in folders, your chats vanish, and nothing connects.
27
67
 
28
- **Lattice AI remembers.** It reads your local files, indexes your conversations, and builds a knowledge graph that links people, projects, concepts, and documents — all on your machine, with zero data leaving your PC.
68
+ **Lattice AI remembers.** It reads your local files, indexes your conversations, and builds a knowledge graph that links people, projects, concepts, and documents — all on your machine. With local models, nothing leaves your PC; cloud models are opt-in and clearly labeled.
29
69
 
30
70
  - **Your data stays local** — everything lives in `~/.ltcai/`, never sent to external servers
31
71
  - **Your AI gets smarter over time** — every chat and file builds your personal knowledge graph
32
- - **One install, works everywhere** — web UI, VS Code, Telegram, MCP clients, all connected to the same brain
72
+ - **One local server, many surfaces** — a single local server powers the web UI, VS Code extension, and optional integrations (Telegram, MCP)
33
73
 
34
74
  ---
35
75
 
@@ -140,7 +180,7 @@ Based on public product behavior as of 2026-05.
140
180
  | Telegram bot | **Yes** | No | No | No |
141
181
  | MCP registry (one-click install) | **Yes** | Partial | Yes | No |
142
182
  | Admin + audit log | **Yes** | Yes | No | No |
143
- | Zero telemetry, self-hosted | **Yes** | Yes | Yes | No |
183
+ | No built-in telemetry, self-hosted | **Yes** | Yes | Yes | No |
144
184
  | One-command public tunnel | **Yes** | No | No | No |
145
185
  | Free | **Yes** | Yes | Yes | No |
146
186
 
@@ -178,7 +218,7 @@ The setup wizard auto-detects your hardware and recommends the best model for yo
178
218
  | | |
179
219
  |---|---|
180
220
  | **Storage** | All data in `~/.ltcai/` on your machine |
181
- | **Telemetry** | None no analytics, no tracking, no phoning home |
221
+ | **Telemetry** | No built-in analytics or product telemetry by default |
182
222
  | **File access** | Approval-token gated — explicit consent per folder |
183
223
  | **Cloud models** | When using cloud APIs, prompts are sent to the provider. Local models keep everything offline. |
184
224
  | **Sensitive files** | `.env`, credentials, keys, certificates auto-excluded from indexing |
@@ -205,8 +245,8 @@ The setup wizard auto-detects your hardware and recommends the best model for yo
205
245
  | **Multi-LLM pipeline** | Plan → Execute → Review with different models |
206
246
  | **MCP server** | Use Lattice tools in Claude Desktop / Cursor |
207
247
  | **MCP registry** | One-click install from registry.modelcontextprotocol.io |
208
- | **Skills marketplace** | 77 official skills (Anthropic + verified third-party) |
209
- | **Plugin directory** | Browse 149 open-source plugins |
248
+ | **Skills browser** | Optional browser for Anthropic + third-party skills |
249
+ | **Plugin browser** | Browse open-source plugins from the registry |
210
250
 
211
251
  ### Access & Communication
212
252
  | Feature | Description |
@@ -363,7 +403,7 @@ Full reference: [docs/mcp-tools.md](docs/mcp-tools.md)
363
403
  | VS Code Marketplace | [marketplace.visualstudio.com](https://marketplace.visualstudio.com/items?itemName=parktaesoo.ltcai) |
364
404
  | Open VSX | [open-vsx.org](https://open-vsx.org/extension/parktaesoo/ltcai) |
365
405
 
366
- Current version: **0.2.2** — [Changelog](docs/CHANGELOG.md)
406
+ Current version: **0.3.2** — [Changelog](docs/CHANGELOG.md)
367
407
 
368
408
  ---
369
409
 
package/docs/CHANGELOG.md CHANGED
@@ -1,5 +1,122 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.2] - 2026-05-29
4
+
5
+ > 안정화 릴리스 — 모델 current 일관성, smoke test 3분류, 보안 대시보드 timezone
6
+ > 버그 수정, 자동 그래프 한국어 노이즈 개선, README 과장 표현 정리.
7
+
8
+ ### Model loading & UI
9
+
10
+ - 웹 UI 모델 선택을 단일 흐름으로 통일(`selectModelByCard` → `prepareAndLoadModel`
11
+ → smoke test → `current` 반영 → 채팅 가능 여부 표시). cloud(`loadSelectedModel`)
12
+ 경로도 백엔드 `current`를 단일 진실원으로 사용. "보이는 모델 ≠ 채팅에 쓰이는
13
+ 모델" 문제 제거.
14
+ - Smoke test 결과를 **ok / degraded / failed** 3분류로 확장
15
+ (`model_compat.classify_smoke_response()`). 특수/role 토큰 누출, 폭주 반복,
16
+ 과도한 길이를 감지. `degraded`는 채팅은 가능하되 UI에 호환성 경고 표시.
17
+ `/models/load`·`/engines/prepare-model/stream` 응답의 `compatibility_status`가
18
+ 3분류 값을 그대로 노출.
19
+
20
+ ### Security dashboard
21
+
22
+ - **Timezone 버그 수정** — audit timestamp는 로컬 시간으로 기록되는데
23
+ "events_today"는 UTC로 계산해 한국 사용자에게 날짜가 어긋나던 문제 수정.
24
+ 새 모듈 `latticeai/core/timezones.py`로 기준 시간대를 통일(`LATTICE_TZ` /
25
+ `LTCAI_TZ` 환경변수, 기본 시스템 로컬). overview 응답에 `timezone` 필드 추가.
26
+
27
+ ### Auto graph curator
28
+
29
+ - 한국어 노이즈 감소 — 조사 제거, 일반어/파일확장자 blacklist, 단일 출처
30
+ 후보 score 감점(여러 출처에서 반복된 개념만 승격).
31
+
32
+ ### Docs & tests
33
+
34
+ - README/확장 설명의 과장 표현 완화(telemetry, skills/plugins 수치 등).
35
+ - 단위 테스트 추가: timezone, smoke 3분류, graph 노이즈, export secret redaction.
36
+ (tests/unit 149 passed)
37
+
38
+ ## [0.3.1] - 2026-05-29
39
+
40
+ > Model loading reliability + auto-graph curation + AI Security & Audit Command Center.
41
+ >
42
+ > 외부 리뷰 5건(모델 추천/다운로드, 사용자 직접 모델 선택, 모델 호환성 계층,
43
+ > 자동 그래프 방향, 관리자 보안/감사 대시보드) 피드백을 모두 반영했다.
44
+
45
+ ### Model loading & inference
46
+
47
+ - 새 모듈 `latticeai/core/model_resolution.py` — `ModelResolution`이
48
+ `input_id / engine / resolved_model / download_id / load_id / expected_current`을
49
+ 하나로 묶어 추천 카드, 다운로드, 로드, router cache, 프론트 current 표시가
50
+ 단계마다 어긋나는 문제를 제거.
51
+ - `prepare_and_load_model()` 와 `/engines/prepare-model/stream`이 동일한
52
+ `ModelResolution`을 공유하도록 통합. LM Studio처럼 `instance_id`가 부여되는
53
+ 엔진은 `resolution.update_after_load()`로 후처리.
54
+ - 로드 직후 `_smoke_test_loaded_model()`가 한국어 짧은 채팅 테스트를 실행 →
55
+ 응답에 `ready_to_chat`, `compatibility_status`, `smoke_test` 필드 추가.
56
+ Cloud 모델은 사용자 비용 발생을 피하기 위해 자동 skip.
57
+ - `/models` 응답에 `engine_options`(local_mlx / ollama / lmstudio / llamacpp /
58
+ vllm 별 실제 model_id)와 `compat_profiles` 추가.
59
+ - 새 엔드포인트 `GET /models/compat-profiles`.
60
+
61
+ ### Model compatibility layer
62
+
63
+ - 새 모듈 `latticeai/core/model_compat.py` — Family detection
64
+ (gpt-oss / gemma / qwen / llama / mistral / phi / deepseek …),
65
+ family 프로파일(stop tokens, disable_draft, postprocess, generation params),
66
+ `fast_postprocess`, `validate_smoke_response`, `record_smoke_result`,
67
+ `compat_cache`. 무거운 검사는 모델 로드 시 1회(Slow Path), 채팅 중에는
68
+ 캐시된 profile만 사용하는 Fast Path. 답변이 깨졌을 때만 1회 retry하는
69
+ Recovery Path 구조.
70
+
71
+ ### Auto knowledge graph curation
72
+
73
+ - 새 모듈 `latticeai/core/graph_curator.py` — 대화/파일/작업 로그에서
74
+ Topic candidate 추출 → alias clustering(자동 병합) → promotion 결정
75
+ (secret 차단, 중복 차단, 출처 최소치) → 파생 이야기 엣지 → 행동 시그널
76
+ 기반 큐레이션. Secret/API key/private key는 그래프 후보에서 자동 제거.
77
+
78
+ ### Frontend — user-trusted current model
79
+
80
+ - `static/scripts/chat.js`의 `prepareAndLoadModel` 결과에서 백엔드
81
+ `response.current`를 신뢰하고, `ready_to_chat=false` 또는
82
+ `compatibility_status=degraded`일 때 사용자에게 호환성 경고 표시.
83
+ - 모델 카드를 직접 클릭할 때도 같은 표준 흐름을 타는
84
+ `window.selectModelByCard()` 헬퍼 추가.
85
+
86
+ ### Admin — AI Security & Audit Command Center
87
+
88
+ - 새 라우터 `latticeai/api/security_dashboard.py`가 11개 엔드포인트 추가:
89
+ `/admin/security/{overview,users,events,events/{id},conversations/{id},`
90
+ `conversations/{id}/raw,files,files/{id},files/{id}/content,raw,export}`.
91
+ - 모든 응답에서 hard secret(`sk-…`, `ghp_…`, `xoxb-…`, `AKIA…`,
92
+ private key block 등)을 자동 redact. 원문/raw 조회는 별도
93
+ `admin_view_sensitive_raw` 감사 이벤트로 기록.
94
+ - 관리자 UI: Security Overview 카드(오늘 이벤트, High Risk, 위험 채팅/파일,
95
+ Secret/외부 전송 차단, 관리자 원문 조회 수, 검토 필요), User Risk Matrix
96
+ (stacked bar), 민감정보 유형 donut chart, 민감 채팅/위험 파일 모니터,
97
+ 감사 타임라인, Raw Data Explorer.
98
+ - 사용자별 막대 클릭 → drill-down. JSON / CSV / XLSX / PDF / TXT
99
+ 추출 지원.
100
+
101
+ ### Tests / CI
102
+
103
+ - 새 단위 테스트 28개 — `tests/unit/test_model_compat.py`,
104
+ `tests/unit/test_model_resolution.py`, `tests/unit/test_graph_curator.py`,
105
+ `tests/unit/test_security_dashboard.py`.
106
+ - `.github/workflows/ci.yml` syntax-check 단계에 4개 새 모듈 추가.
107
+ - 새 `.github/workflows/release.yml` — tag `v*` 푸시 시 PyPI / npm /
108
+ VS Code Marketplace / Open VSX 자동 배포(필요 secrets: `PYPI_TOKEN`,
109
+ `NPM_TOKEN`, `VSCE_PAT`, `OVSX_TOKEN`). 해당 secret이 비어 있는 job은
110
+ 자동 skip.
111
+
112
+ ### Fixed
113
+
114
+ - FastAPI에서 `Request` 인자에 `= None` 디폴트 사용 시 발생하던 잠재 문제 수정
115
+ (`security_dashboard.py` `/admin/security/raw`).
116
+ - `gpt-oss` family postprocess 순서를
117
+ `trim_after_user_marker → strip_role_tokens`로 보정 — `<|user|>` 마커가
118
+ 먼저 제거돼 trim이 동작하지 않던 버그.
119
+
3
120
  ## [0.3.0] - 2026-05-27
4
121
 
5
122
  ### Knowledge Graph — LLM Structured Output Extraction
@@ -38,14 +38,22 @@ def create_knowledge_graph_router(
38
38
  """Serve the interactive knowledge graph canvas UI."""
39
39
  graph()
40
40
  require_user(request)
41
- return FileResponse(static_dir / "graph.html")
41
+ response = FileResponse(static_dir / "graph.html")
42
+ response.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"
43
+ response.headers["Pragma"] = "no-cache"
44
+ response.headers["Expires"] = "0"
45
+ return response
42
46
 
43
47
  @router.get("/knowledge-graph")
44
48
  async def knowledge_graph_legacy_page(request: Request):
45
49
  """Backward-compatible route for the graph page."""
46
50
  graph()
47
51
  require_user(request)
48
- return FileResponse(static_dir / "graph.html")
52
+ response = FileResponse(static_dir / "graph.html")
53
+ response.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"
54
+ response.headers["Pragma"] = "no-cache"
55
+ response.headers["Expires"] = "0"
56
+ return response
49
57
 
50
58
  @router.get("/knowledge-graph/stats")
51
59
  async def knowledge_graph_stats(request: Request):