ltcai 9.8.0 → 9.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 (74) hide show
  1. package/README.md +40 -28
  2. package/docs/BENCHMARKS.md +107 -0
  3. package/docs/CHANGELOG.md +35 -0
  4. package/docs/CI_AND_RELEASE_GATES.md +106 -0
  5. package/docs/COMMUNITY_AND_PLUGINS.md +1 -1
  6. package/docs/DEVELOPMENT.md +11 -8
  7. package/docs/ONBOARDING.md +1 -1
  8. package/docs/OPERATIONS.md +15 -6
  9. package/docs/PERFORMANCE.md +9 -1
  10. package/docs/SECURITY_AUDIT.md +91 -0
  11. package/docs/TRUST_MODEL.md +1 -1
  12. package/docs/USABILITY_AUDIT.md +164 -0
  13. package/docs/WHY_LATTICE.md +1 -1
  14. package/docs/architecture.md +4 -2
  15. package/docs/kg-schema.md +1 -1
  16. package/docs/spec-vs-impl.md +8 -1
  17. package/lattice_brain/__init__.py +1 -1
  18. package/lattice_brain/runtime/multi_agent.py +1 -1
  19. package/latticeai/__init__.py +1 -1
  20. package/latticeai/api/review_queue.py +7 -0
  21. package/latticeai/core/agent.py +105 -8
  22. package/latticeai/core/agent_eval.py +99 -1
  23. package/latticeai/core/legacy_compatibility.py +1 -1
  24. package/latticeai/core/marketplace.py +1 -1
  25. package/latticeai/core/tool_governor.py +92 -1
  26. package/latticeai/core/workspace_os.py +1 -1
  27. package/latticeai/services/architecture_readiness.py +1 -1
  28. package/latticeai/services/change_proposals.py +165 -23
  29. package/latticeai/services/product_readiness.py +1 -1
  30. package/latticeai/services/tool_dispatch.py +33 -0
  31. package/package.json +5 -3
  32. package/scripts/bench_models.py +312 -0
  33. package/scripts/check_bundle_budget.mjs +103 -0
  34. package/scripts/check_current_release_docs.mjs +1 -1
  35. package/scripts/check_doc_status.mjs +149 -0
  36. package/scripts/generate_sbom.py +70 -0
  37. package/src-tauri/Cargo.lock +1 -1
  38. package/src-tauri/Cargo.toml +1 -1
  39. package/src-tauri/tauri.conf.json +1 -1
  40. package/static/app/asset-manifest.json +27 -11
  41. package/static/app/assets/Act-CfOPUKPs.js +2 -0
  42. package/static/app/assets/{Brain-BMkgdWnI.js → Brain-Cgkh0Hpn.js} +2 -2
  43. package/static/app/assets/BrainHome-D8e3wQiW.js +3 -0
  44. package/static/app/assets/BrainSignals-BjRBA18L.js +1 -0
  45. package/static/app/assets/Capture-CQQYQ1Ga.js +1 -0
  46. package/static/app/assets/CommandPalette-pss56Mg4.js +1 -0
  47. package/static/app/assets/Library-CoI3xYJk.js +1 -0
  48. package/static/app/assets/LivingBrain-CaU_hCxQ.js +1 -0
  49. package/static/app/assets/ProductFlow-Db-1O71-.js +1 -0
  50. package/static/app/assets/System-Dfocn0zN.js +1 -0
  51. package/static/app/assets/bot-Bp2x1i6F.js +1 -0
  52. package/static/app/assets/circle-check-CyGal42W.js +1 -0
  53. package/static/app/assets/cpu-DQFk82hG.js +1 -0
  54. package/static/app/assets/download-C70gKQVi.js +1 -0
  55. package/static/app/assets/folder-open-DNGytsVw.js +1 -0
  56. package/static/app/assets/hard-drive-CYo_bEl4.js +1 -0
  57. package/static/app/assets/i18n-BBMJshCW.js +7 -0
  58. package/static/app/assets/index-BjaXCeOZ.js +10 -0
  59. package/static/app/assets/{index-7gY9t9Sd.css → index-BqRcLZR3.css} +1 -1
  60. package/static/app/assets/input-ChWD-Fsh.js +1 -0
  61. package/static/app/assets/navigation-D9D9_FPC.js +1 -0
  62. package/static/app/assets/network-DzLDGmtV.js +1 -0
  63. package/static/app/assets/primitives-CmaSAyGG.js +1 -0
  64. package/static/app/assets/sparkles-DXiaM1NS.js +1 -0
  65. package/static/app/assets/textarea-CV43-o79.js +1 -0
  66. package/static/app/index.html +4 -2
  67. package/static/sw.js +1 -1
  68. package/static/app/assets/Act-Dd3z8AzF.js +0 -2
  69. package/static/app/assets/Capture-D2Aw9gkv.js +0 -1
  70. package/static/app/assets/Library-Yreq-KW5.js +0 -1
  71. package/static/app/assets/System-CXNmmtEo.js +0 -1
  72. package/static/app/assets/index-CndfILiF.js +0 -18
  73. package/static/app/assets/primitives-DxsIXb6G.js +0 -1
  74. package/static/app/assets/textarea-DH7ne8VI.js +0 -1
package/README.md CHANGED
@@ -11,7 +11,7 @@
11
11
  [![CI Status](https://github.com/TaeSooPark-PTS/LatticeAI/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/TaeSooPark-PTS/LatticeAI/actions/workflows/ci.yml)
12
12
  [![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)
13
13
 
14
- ![v9.8.0 Living Brain walkthrough](output/release/v9.8.0/gifs/v9.8.0-living-brain-walkthrough.gif)
14
+ ![v9.9.0 Living Brain walkthrough](output/release/v9.9.0/gifs/v9.9.0-living-brain-walkthrough.gif)
15
15
 
16
16
  Chat, files, folders, notes, and web pages all flow into one durable knowledge
17
17
  graph on your computer. Any model — local MLX or cloud — can speak with that
@@ -24,9 +24,9 @@ memory. Nothing leaves your machine without explicit consent.
24
24
 
25
25
  | | |
26
26
  | --- | --- |
27
- | **Chat with a Brain that remembers** — every conversation grows durable, source-linked memory ![Brain Chat](output/release/v9.8.0/screenshots/04-brain-chat-home.png) | **See how knowledge connects** — a real relationship graph, not a file list ![Memory Graph](output/release/v9.8.0/screenshots/05-memory-graph.png) |
28
- | **Capture anything** — files, whole folders, notes, screenshots, web pages ![Capture](output/release/v9.8.0/screenshots/06-capture.png) | **Automate with review** — agent changes become proposals you approve first ![Review Center](output/release/v9.8.0/screenshots/12-review-center.png) |
29
- | **Pick a model in one click** — recommended local models for your hardware ![Recommended Models](output/release/v9.8.0/screenshots/02-recommended-models.png) | **Stay in control** — audit, roles, retention in a separate admin surface ![Admin Console](output/release/v9.8.0/screenshots/10-admin-console.png) |
27
+ | **Chat with a Brain that remembers** — every conversation grows durable, source-linked memory ![Brain Chat](output/release/v9.9.0/screenshots/04-brain-chat-home.png) | **See how knowledge connects** — a real relationship graph, not a file list ![Memory Graph](output/release/v9.9.0/screenshots/05-memory-graph.png) |
28
+ | **Capture anything** — files, whole folders, notes, screenshots, web pages ![Capture](output/release/v9.9.0/screenshots/06-capture.png) | **Automate with review** — agent changes become proposals you approve first ![Review Center](output/release/v9.9.0/screenshots/12-review-center.png) |
29
+ | **Pick a model in one click** — recommended local models for your hardware ![Recommended Models](output/release/v9.9.0/screenshots/02-recommended-models.png) | **Stay in control** — audit, roles, retention in a separate admin surface ![Admin Console](output/release/v9.9.0/screenshots/10-admin-console.png) |
30
30
 
31
31
  ## Why Lattice AI
32
32
 
@@ -57,36 +57,45 @@ First-run flow — wake the Brain, pick the owner, load a recommended model:
57
57
 
58
58
  | | | |
59
59
  | --- | --- | --- |
60
- | ![Login](output/release/v9.8.0/screenshots/01-login.png) | ![Model install](output/release/v9.8.0/screenshots/03-install-load-progress.png) | ![Model library](output/release/v9.8.0/screenshots/07-model-library.png) |
60
+ | ![Login](output/release/v9.9.0/screenshots/01-login.png) | ![Model install](output/release/v9.9.0/screenshots/03-install-load-progress.png) | ![Model library](output/release/v9.9.0/screenshots/07-model-library.png) |
61
61
 
62
62
  Screenshot index and capture notes:
63
- [output/release/v9.8.0/SCREENSHOT_INDEX.md](output/release/v9.8.0/SCREENSHOT_INDEX.md)
63
+ [output/release/v9.9.0/SCREENSHOT_INDEX.md](output/release/v9.9.0/SCREENSHOT_INDEX.md)
64
64
 
65
65
  ## Current Release
66
66
 
67
- The current release is **9.8.0 — Honest Knowledge Pipeline**:
68
-
69
- - Every ingest (file, folder, web) now reports an extraction-quality score and
70
- warns on low-quality captures before they pollute the Brain.
71
- - Background folder ingestion is robust: per-item errors don't kill the job,
72
- progress (processed/total) is visible, and interrupted jobs resume — with a
73
- jobs API (`/api/ingestion/jobs`) and UI progress.
74
- - The Brain signals honestly: chat answers carry a `context_quality` marker
75
- when graph context is limited, and `/api/brain/vector-freshness` plus a UI
76
- banner show when knowledge is still waiting for vector indexing.
77
- - The agent evaluation gate grew to 16 deterministic scenarios, adding
78
- ingestion, concept-extraction, RAG-grounded answering, and automation
79
- proposal paths; automation suggestions gain confidence scoring and dedup.
67
+ The current release is **9.9.0 — Fail-Closed Trust**:
68
+
69
+ - **Change proposals can't clobber your edits.** A proposal now records the
70
+ original content hash; if the file changed before you approve, the apply is
71
+ rejected with a conflict instead of silently overwriting your work, and the
72
+ write is atomic. Duplicate/concurrent approvals apply exactly once.
73
+ - **A confused verifier never reports success.** If the agent's critic output
74
+ can't be parsed (after one strict retry), the run ends as `NEEDS_REVIEW`
75
+ instead of a fabricated "done"; completion now requires a valid PASS *and*
76
+ real execution evidence.
77
+ - **Every mutating tool is governed.** A single-source inventory classifies
78
+ each side-effecting tool; a CI gate fails closed if a new mutator ships
79
+ ungoverned, and tools that would overwrite existing content without a
80
+ reviewable proposal are blocked rather than applied.
81
+ - **Honest onboarding.** Device analysis is modeled as
82
+ `loading | ready | unavailable`; a failed probe no longer fabricates a
83
+ "supported, ready on this computer" model card — it shows the cause, a
84
+ retry, and "continue without a model."
85
+ - **Leaner & audited.** Initial JS bundle is ~22% smaller (lazy-loaded heavy
86
+ views, with a CI budget), plus dependency/SBOM audit and scheduled
87
+ PostgreSQL integration workflows, a security-scan report, a model benchmark
88
+ harness, and current/architecture documentation classification.
80
89
 
81
90
  Release notes: [RELEASE.md](RELEASE.md) · Full history: [docs/CHANGELOG.md](docs/CHANGELOG.md)
82
91
 
83
- Expected artifacts for 9.8.0 release must use exact filenames:
92
+ Expected artifacts for 9.9.0 release must use exact filenames:
84
93
 
85
- - `dist/ltcai-9.8.0-py3-none-any.whl`
86
- - `dist/ltcai-9.8.0.tar.gz`
87
- - `ltcai-9.8.0.tgz`
88
- - `dist/ltcai-9.8.0.vsix`
89
- - `src-tauri/target/release/bundle/dmg/Lattice AI_9.8.0_aarch64.dmg`
94
+ - `dist/ltcai-9.9.0-py3-none-any.whl`
95
+ - `dist/ltcai-9.9.0.tar.gz`
96
+ - `ltcai-9.9.0.tgz`
97
+ - `dist/ltcai-9.9.0.vsix`
98
+ - `src-tauri/target/release/bundle/dmg/Lattice AI_9.9.0_aarch64.dmg`
90
99
 
91
100
  Do not use wildcard artifact uploads. Package registry publishing remains owner-run.
92
101
 
@@ -106,16 +115,19 @@ See [ARCHITECTURE.md](ARCHITECTURE.md) for details and
106
115
 
107
116
  - External package registries are owner-published and can lag behind GitHub.
108
117
  - PostgreSQL/pgvector is optional scale/migration tooling. SQLite remains the
109
- live local Brain store in 9.8.0.
118
+ live local Brain store in 9.9.0.
110
119
  - Docker, model downloads, cloud model calls, Telegram, Brain Network, and
111
120
  update checks require explicit user action.
112
- - Conversation does not fabricate answers when no model is loaded; LLM-free
113
- simulation is labeled as such.
121
+ - Conversation does not fabricate answers when no model is loaded. Agent and
122
+ workflow simulation without a loaded LLM is deterministic and LLM-free (it
123
+ does not call a model) — labeled as such, never presented as autonomous
124
+ model success.
114
125
 
115
126
  ## Release History
116
127
 
117
128
  | Version | Theme |
118
129
  | --- | --- |
130
+ | 9.9.0 | Fail-Closed Trust |
119
131
  | 9.8.0 | Honest Knowledge Pipeline |
120
132
  | 9.7.0 | Proactive Hybrid Brain |
121
133
  | 9.6.0 | Trusted Agent Loop |
@@ -0,0 +1,107 @@
1
+ # Model Robustness Benchmarks
2
+
3
+ > Status: reference 2026-07-21
4
+
5
+ Methodology and results for `scripts/bench_models.py`, a harness that measures
6
+ how well the agent loop turns model output into executable actions across model
7
+ quality tiers. Companion to [CI & Release Gates](CI_AND_RELEASE_GATES.md).
8
+
9
+ ## What is measured
10
+
11
+ The product claim is that the Brain stays durable "across any AI model": weaker
12
+ models emit sloppier output, but the loop repairs it and still completes the
13
+ task. The harness turns that into three numbers per tier:
14
+
15
+ - **success_rate** — fraction of model outputs that become a valid agent action
16
+ (the task can proceed).
17
+ - **repair_rate** — of the successful parses, the fraction that succeeded *only
18
+ because* the loop's tolerant parser had to repair the output. High = "this
19
+ tier leans hard on the loop's robustness".
20
+ - **latency_ms** — see the honesty note below.
21
+
22
+ Every output is fed through the **real** parser the production loop uses:
23
+ `latticeai.core.agent.extract_action_details` (called from `agent.py` in the
24
+ plan/execute/verify phases). The harness does not reimplement parsing — it
25
+ measures the shipping code. Its known repair tolerances are: `think_strip`
26
+ (strip `<think>` blocks), `fence` (unwrap ```` ```json ````), `slice` (extract
27
+ the `{...}` span from prose), `trailing_comma`, and `python_literal`
28
+ (`ast.literal_eval` of a single-quoted dict).
29
+
30
+ An `agent-loop` reference row additionally runs the real
31
+ `latticeai.core.agent_eval.run_agent_eval` state machine over its 20 scripted
32
+ scenarios and reports its success and recovery rates.
33
+
34
+ ## Honesty note on latency
35
+
36
+ In **scripted** mode, `latency_ms` is the **parse+repair cost only**
37
+ (microseconds). It is **not** model inference time and must not be read as such.
38
+ True generation latency is only meaningful in **live** mode against a real
39
+ endpoint.
40
+
41
+ ## Modes
42
+
43
+ 1. **scripted** (default; no model, no network): a curated corpus of
44
+ model-realistic outputs per tier. Deterministic; proves the harness works and
45
+ exposes the loop's repair boundary. Some weak-tier entries are *intentionally
46
+ broken* past the repair boundary so `success_rate < 1.0` is a real finding,
47
+ not a rigged demo. A self-check asserts every corpus entry's expected
48
+ parse/fail outcome matches reality (0 mismatches = healthy).
49
+ 2. **live** (opt-in): sends a fixed prompt set to an OpenAI-compatible local
50
+ endpoint (LM Studio / llama.cpp / vLLM), runs the real completions through
51
+ the same parser, and reports **true** generation latency. Falls back to a
52
+ clear "SKIPPED" line if the endpoint is unreachable.
53
+
54
+ ## Running
55
+
56
+ ```bash
57
+ # Scripted matrix (always works):
58
+ .venv/bin/python scripts/bench_models.py
59
+
60
+ # With machine-readable output:
61
+ .venv/bin/python scripts/bench_models.py --json bench.json
62
+
63
+ # Against a real local model (OpenAI-compatible endpoint):
64
+ .venv/bin/python scripts/bench_models.py \
65
+ --live-endpoint http://127.0.0.1:1234/v1 --model my-local-model
66
+ ```
67
+
68
+ Exit code is non-zero only if the harness self-check finds an inconsistency (a
69
+ real bug); a low score on a weak tier is a finding, not a failure.
70
+
71
+ ## Reference results (scripted, 2026-07-21)
72
+
73
+ Captured on the maintainer's machine; latency is parse-only.
74
+
75
+ | Tier | success_rate | repair_rate | n | repairs exercised |
76
+ |------|-------------:|------------:|--:|-------------------|
77
+ | frontier (clean JSON) | 1.00 | 0.00 | 6 | — |
78
+ | mid-local (fenced/prose/commas) | 1.00 | 1.00 | 6 | fence×3, slice×1, trailing_comma×2 |
79
+ | weak-local (think/py-literal/broken) | 0.625 | 1.00 | 8 | think_strip×2, python_literal×2, fence×1, trailing_comma×1 |
80
+
81
+ Agent-loop reference (real state machine): **success_rate 1.00**, **recovery_rate
82
+ 0.70** over 20 scenarios. Harness self-check: **0 mismatches**.
83
+
84
+ Reading the matrix: the mid tier is fully recoverable — every output needed a
85
+ repair, and all succeeded, which is exactly the "durable across models" claim in
86
+ action. The weak tier's 0.625 is the honest boundary: the 3 genuinely broken
87
+ outputs (pure prose, missing `action` field, truncated braces) cannot and should
88
+ not parse.
89
+
90
+ ## Measurable vs not-measurable (honest scope)
91
+
92
+ **This harness can measure:**
93
+ - Whether a given model's raw output survives the loop's parser (success_rate).
94
+ - How much the loop's repair layer is doing the work (repair_rate + which
95
+ tolerances fire).
96
+ - Real end-to-end generation latency in `live` mode.
97
+ - End-to-end loop completion over the scripted scenario suite.
98
+
99
+ **This harness does NOT measure:**
100
+ - Task *correctness* / answer quality — only that an action is well-formed and
101
+ executable, not that it is the *right* action.
102
+ - Multi-turn reasoning quality or tool-selection accuracy beyond the scripted
103
+ scenarios.
104
+ - Throughput/latency under concurrency or on other hardware.
105
+ - Any cloud model (no keys are used; live mode targets local endpoints only).
106
+ - A representative sample of "all models" — scripted tiers are archetypes, not a
107
+ statistical population. For real numbers on a specific model, use `live` mode.
package/docs/CHANGELOG.md CHANGED
@@ -4,6 +4,41 @@ The top entry is either the current unreleased main-branch work or the current
4
4
  release line. Older entries are historical and may describe behavior as it
5
5
  existed at that release.
6
6
 
7
+ ## [9.9.0] - 2026-07-21
8
+
9
+ ### Fixed
10
+ - Change proposals record the target's original content hash and existence;
11
+ approval re-hashes the disk and rejects a modified/deleted/created target
12
+ with a 409 conflict instead of overwriting newer content. Applies are atomic
13
+ (`os.replace`) and serialized so duplicate/concurrent approvals apply once.
14
+ - The agent verifier no longer fabricates a PASS on unparseable critic output:
15
+ one strict repair retry, then the new terminal `NEEDS_REVIEW` state. `DONE`
16
+ now requires a valid PASS and deterministic execution evidence; the loose
17
+ `next_state == DONE` success path is removed.
18
+ - Device analysis no longer fabricates a `supported: true` model card on probe
19
+ failure; the recommendation screen models `loading | ready | unavailable`
20
+ and offers retry / continue-without-a-model.
21
+
22
+ ### Added
23
+ - `MUTATING_TOOL_INVENTORY` single-source governance classification for every
24
+ side-effecting tool, a fail-closed CI coverage gate, and dispatch-level
25
+ blocking (409) of existing-content overwrites that cannot be staged as a
26
+ reviewable proposal (`create_docx/xlsx/pptx/pdf`, `local_write`).
27
+ - Agent-eval result classification (`correct_completion` / `safe_termination`
28
+ / `needs_review` / `failed`) and fail-closed verifier scenarios (20 total).
29
+ - CI: `dependency-audit.yml` (pip-audit + npm audit + CycloneDX SBOM) and
30
+ scheduled `postgres-integration.yml`; all GitHub Actions SHA-pinned; a
31
+ frontend bundle-budget gate (150 KiB gzip).
32
+ - `docs/SECURITY_AUDIT.md`, `docs/BENCHMARKS.md` + `scripts/bench_models.py`,
33
+ `docs/USABILITY_AUDIT.md`, `docs/CI_AND_RELEASE_GATES.md`, and a
34
+ documentation status/link gate (`scripts/check_doc_status.mjs`).
35
+
36
+ ### Changed
37
+ - Initial JS bundle reduced ~22% (180.3 → 141.6 KiB gzip) via lazy-loaded
38
+ onboarding, Brain home, and command palette.
39
+ - `ARCHITECTURE.md` verified against the real module layout and corrected;
40
+ stale 9.6-era operational/feature/development docs updated and classified.
41
+
7
42
  ## [9.8.0] - 2026-07-20
8
43
 
9
44
  ### Added
@@ -0,0 +1,106 @@
1
+ # CI & Release Gates
2
+
3
+ > Status: reference 2026-07-21
4
+
5
+ Reference for the GitHub Actions workflows that guard `main` and releases, the
6
+ supply-chain hardening applied to them, and the recommended branch-protection
7
+ configuration. Companion to [SECURITY_AUDIT.md](SECURITY_AUDIT.md) and
8
+ [BENCHMARKS.md](BENCHMARKS.md).
9
+
10
+ ## Workflows
11
+
12
+ | Workflow | File | Triggers | Purpose |
13
+ |----------|------|----------|---------|
14
+ | CI | `.github/workflows/ci.yml` | push/PR to `main` | Lint, typecheck, unit + integration tests, brain/agent eval gates, build + wheel smoke |
15
+ | Release | `.github/workflows/release.yml` | tags `v*` / `[0-9]*` | Build & validate all artifacts (no publish) |
16
+ | Visual Smoke | `.github/workflows/visual.yml` | push/PR, nightly cron, dispatch | Playwright visual smoke |
17
+ | **Dependency Audit** | `.github/workflows/dependency-audit.yml` | push/PR, weekly cron, dispatch | pip-audit + npm audit + CycloneDX SBOMs |
18
+ | **Postgres Integration** | `.github/workflows/postgres-integration.yml` | weekly cron, dispatch | Live SQLite→Postgres/pgvector migration test |
19
+
20
+ The last two were added for the P2 deployment-trust / supply-chain workstream.
21
+
22
+ ## Supply-chain hardening: pinned actions
23
+
24
+ Every third-party `uses:` in every workflow is pinned to an **immutable commit
25
+ SHA**, with the human-readable version in a trailing comment. A moving tag
26
+ (`@v4`) can be repointed by the action owner; a SHA cannot. SHAs were resolved
27
+ from the authoritative upstream refs via `git ls-remote --tags` on 2026-07-21.
28
+
29
+ | Action | Tag | Pinned commit SHA |
30
+ |--------|-----|-------------------|
31
+ | actions/checkout | v4.4.0 | `11d5960a326750d5838078e36cf38b85af677262` |
32
+ | actions/checkout | v5.1.0 | `fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09` |
33
+ | actions/setup-python | v5.6.0 | `a26af69be951a213d495a4c3e4e4022e16d87065` |
34
+ | actions/setup-python | v6.3.0 | `ece7cb06caefa5fff74198d8649806c4678c61a1` |
35
+ | actions/setup-node | v5.0.0 | `a0853c24544627f65ddf259abe73b1d18a591444` |
36
+ | actions/upload-artifact | v4.6.2 | `ea165f8d65b6e75b540449e92b4886f43607fa02` |
37
+
38
+ Pinning coverage: **100% of current `uses:` entries** across `ci.yml`,
39
+ `release.yml`, `visual.yml`, `dependency-audit.yml`, and
40
+ `postgres-integration.yml`. All are first-party `actions/*`. If a third-party
41
+ action is added later, resolve and pin its SHA the same way before merge.
42
+
43
+ ## Dependency-audit gate posture (conservative)
44
+
45
+ The audit workflow is intentionally **non-blocking on day-to-day PRs** and
46
+ **strict on the scheduled/dispatch run**:
47
+
48
+ - `push` / `pull_request`: `pip-audit` and `npm audit` run with
49
+ `continue-on-error` keyed on the event name, so a newly-disclosed CVE in a
50
+ transitive dependency never reddens an unrelated PR. Findings still appear in
51
+ the job summary and uploaded report artifacts.
52
+ - `schedule` (weekly) / `workflow_dispatch`: the same steps run **strict** —
53
+ `pip-audit --strict` fails on any known vuln; `npm audit --audit-level=high`
54
+ fails on high/critical. This is the loud channel for triage.
55
+
56
+ CycloneDX SBOMs (`sbom-python.json`, `sbom-npm.json`) are produced every run and
57
+ uploaded as artifacts. Regenerate locally with `scripts/generate_sbom.py`.
58
+
59
+ **To promote to a required blocking PR check:** remove the `continue-on-error`
60
+ expressions in `dependency-audit.yml` and add `python-audit` / `npm-audit` to
61
+ the required-checks list below.
62
+
63
+ ## Postgres integration gate
64
+
65
+ `postgres-integration.yml` runs the migration-integrity suite
66
+ (`tests/integration/test_v42_postgres_migration_live.py`) that is skipped
67
+ everywhere else. The suite is gated by `LTCAI_LIVE_POSTGRES_DOCKER_CONSENT=1`;
68
+ the workflow sets that variable, and the test itself starts and tears down a
69
+ `pgvector/pgvector:pg16` container via `docker compose` (preinstalled on
70
+ GitHub-hosted `ubuntu-latest`). It is deliberately kept off the PR path (slow,
71
+ image pull, needs Docker) and runs weekly + on demand.
72
+
73
+ ## Recommended branch protection for `main`
74
+
75
+ Required status checks (blocking):
76
+
77
+ - `CI / Test (Python 3.11)`
78
+ - `CI / Test (Python 3.12)`
79
+ - `CI / Integration smoke test`
80
+ - `CI / Build package`
81
+ - `Visual Smoke / Playwright visual smoke`
82
+
83
+ Advisory / non-blocking today (promote when the team is ready):
84
+
85
+ - `Dependency Audit / Python dependency audit (pip-audit)`
86
+ - `Dependency Audit / npm dependency audit`
87
+
88
+ Additional recommended settings: require PRs before merge, require branches to
89
+ be up to date, require linear history, and dismiss stale approvals on new
90
+ commits.
91
+
92
+ ## Release gate (publication safety)
93
+
94
+ `release.yml` builds and validates artifacts only — it never publishes. Package
95
+ publication (PyPI / npm / VS Code Marketplace / Open VSX) is a manual step
96
+ (`npm run publish:*`) using **exact version filenames**, never a `dist/*` glob,
97
+ so pushing a tag can never publish by accident. See
98
+ [../RELEASE.md](../RELEASE.md) for the full procedure.
99
+
100
+ ## Limitations (honest)
101
+
102
+ - Branch-protection rules are repository settings and cannot be committed from a
103
+ workflow; the list above is the recommended configuration to apply in GitHub
104
+ settings, not an enforced artifact.
105
+ - The audit gate depends on upstream advisory databases (OSV, npm registry);
106
+ absence of findings means "nothing known", not "provably safe".
@@ -1,6 +1,6 @@
1
1
  # Community And Plugins
2
2
 
3
- Current release: **9.8.0 — Honest Knowledge Pipeline**.
3
+ Current release: **9.9.0 — Fail-Closed Trust**.
4
4
 
5
5
  LatticeAI defines the path from a strong local-first framework (8.4.0
6
6
  action-aware baseline, 8.5.0 registry+DI hardening, 8.6.0 capture/navigation
@@ -1,10 +1,13 @@
1
1
  # Lattice AI Development
2
2
 
3
- Current release: **9.8.0Honest Knowledge Pipeline**.
3
+ > **Status: canonical** — current contributor guidance, kept in sync with the
4
+ > current release.
5
+
6
+ Current release: **9.9.0 — Fail-Closed Trust**.
4
7
 
5
8
  This document is for contributors working on the local-first Digital Brain
6
9
  codebase. Product positioning and quick start stay in `README.md`; release
7
- history is intentionally limited to 8.0.0-9.6.0 in `docs/CHANGELOG.md` and
10
+ history is intentionally limited to 8.0.0-9.9.0 in `docs/CHANGELOG.md` and
8
11
  `RELEASE.md`.
9
12
 
10
13
  ## Product Contract
@@ -153,10 +156,10 @@ For user-facing, API, runtime, release, or packaging changes, check:
153
156
  Release/publish examples must use exact target-version filenames. Do not
154
157
  document wildcard artifact upload commands.
155
158
 
156
- For 9.6.0 release work, exact artifacts are:
159
+ For 9.9.0 release work, exact artifacts are:
157
160
 
158
- - `dist/ltcai-9.6.0-py3-none-any.whl`
159
- - `dist/ltcai-9.6.0.tar.gz`
160
- - `ltcai-9.6.0.tgz`
161
- - `dist/ltcai-9.6.0.vsix`
162
- - `src-tauri/target/release/bundle/dmg/Lattice AI_9.6.0_aarch64.dmg`
161
+ - `dist/ltcai-9.9.0-py3-none-any.whl`
162
+ - `dist/ltcai-9.9.0.tar.gz`
163
+ - `ltcai-9.9.0.tgz`
164
+ - `dist/ltcai-9.9.0.vsix`
165
+ - `src-tauri/target/release/bundle/dmg/Lattice AI_9.9.0_aarch64.dmg`
@@ -1,6 +1,6 @@
1
1
  # Lattice AI Onboarding
2
2
 
3
- Current release: **9.8.0 — Honest Knowledge Pipeline**.
3
+ Current release: **9.9.0 — Fail-Closed Trust**.
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
@@ -1,13 +1,18 @@
1
- # Lattice AI — Operations Guide (v9.6.0)
1
+ # Lattice AI — Operations Guide (v9.9.0)
2
+
3
+ > **Status: canonical** — kept in sync with the current release. Storage layout
4
+ > below reflects the SQLite live Brain store and workspace scoping, not the
5
+ > earlier Markdown-per-node graph.
2
6
 
3
7
  ## 1. 데이터 파일 위치
4
8
 
5
9
  | 파일 | 용도 |
6
10
  |------|------|
7
11
  | `~/.ltcai/users.json` | 사용자 계정 (scrypt 해시 저장) |
8
- | `~/.ltcai/history.json` | 대화 히스토리 |
12
+ | `~/.ltcai/knowledge_graph.sqlite` | Brain 라이브 스토어 — Knowledge Graph 노드/엣지/청크, 대화 히스토리, 프로비넌스 (workspace_id 스코프) |
13
+ | `~/.ltcai/knowledge_graph_blobs/` | 업로드 원본/blob 저장소 |
9
14
  | `~/.ltcai/audit.json` | 감사 로그 (agent 실행, 사용자 변경 등) |
10
- | `~/.ltcai/brain/` | Knowledge Graph 노드 (Markdown) |
15
+ | `~/.ltcai/chat_history.json` | 레거시 대화 히스토리 최초 1회 SQLite로 idempotent 임포트 후 미사용 |
11
16
  | `~/ltcai-agent/` | Agent workspace (agent가 생성한 파일) |
12
17
 
13
18
  ## 2. 백업 및 복구
@@ -112,8 +117,10 @@ pip install --upgrade ltcai
112
117
 
113
118
  ### 6.3 데이터 마이그레이션 주의사항
114
119
  - `users.json` 스키마 변경 시: 서버가 자동으로 누락 필드를 기본값으로 보완합니다.
115
- - `history.json` 스키마 변경 시: 하위 호환성 유지. 구버전 레코드는 무시됩니다.
116
- - `brain/` Knowledge Graph: Markdown 파일 기반이므로 별도 마이그레이션 없음.
120
+ - 대화 히스토리: SQLite 라이브 스토어에 저장됩니다. 레거시 `chat_history.json`은
121
+ 최초 실행 1회 idempotent 임포트된 사용되지 않습니다.
122
+ - `knowledge_graph.sqlite` Knowledge Graph: SQLite 스키마 마이그레이션은 부팅 시
123
+ 적용되며 읽기 호환성/롤백/동등성 테스트로 보호됩니다.
117
124
 
118
125
  ## 7. 공개 서버 체크리스트
119
126
 
@@ -135,7 +142,9 @@ pip install --upgrade ltcai
135
142
  - 대화 히스토리는 `user_email` 필드로 필터링됩니다.
136
143
  - Agent workspace (`~/ltcai-agent/`)는 현재 단일 공유 디렉토리입니다.
137
144
  멀티 유저 환경에서는 `~/ltcai-agent/<email>/` 구조로 분리를 권장합니다.
138
- - Knowledge Graph (`brain/`) 역시 단일 공유 공간입니다.
145
+ - Knowledge Graph `workspace_id`로 스코프됩니다. 없는 스코프의 노드는
146
+ 기본 비공개(fail-closed)이며, 레거시 글로벌 읽기는 명시적 호환성 옵트인이
147
+ 있을 때만 허용됩니다.
139
148
 
140
149
  ## 9. 서버 시작 / 종료
141
150
 
@@ -1,5 +1,13 @@
1
1
  # Knowledge Graph Performance Baseline
2
2
 
3
+ > **Status: reference** — a synthetic regression baseline, not a
4
+ > current-release measurement. The numbers below were last captured on the
5
+ > v9.6.0 working tree (see provenance line) and are carried forward as the
6
+ > comparison reference. The 9.7.0-9.8.0 line added graph-layer paths
7
+ > (`hybrid_search`, vector freshness, extraction-quality scoring), so
8
+ > regenerate with `scripts/profile_kg.py` on the current tree before treating
9
+ > these as 9.8.0 numbers.
10
+
3
11
  Synthetic performance and memory baseline for `KnowledgeGraphStore`
4
12
  (`lattice_brain/graph/`). Measured with `scripts/profile_kg.py`.
5
13
 
@@ -34,7 +42,7 @@ Run it:
34
42
  .venv/bin/python scripts/profile_kg.py --json # machine-readable
35
43
  ```
36
44
 
37
- ## Measured baseline (2026-07-20, v9.6.0 working tree)
45
+ ## Measured baseline (last captured on the v9.6.0 working tree)
38
46
 
39
47
  Apple Silicon (darwin), Python 3.x from `.venv`, SQLite with FTS5 trigram
40
48
  available, tracemalloc enabled.
@@ -0,0 +1,91 @@
1
+ # Security Audit — Static Scan Snapshot
2
+
3
+ > Status: audit snapshot 2026-07-21
4
+
5
+ This is a point-in-time static-analysis snapshot for release **v9.8.0**. It
6
+ records exactly which scanners ran, the raw findings, and an honest per-finding
7
+ real-risk assessment. It is not a guarantee of absence of vulnerabilities; it is
8
+ evidence of what the listed tools saw on the listed date.
9
+
10
+ Related: [CI & Release Gates](CI_AND_RELEASE_GATES.md) documents how these scans
11
+ are wired into continuous integration (`.github/workflows/dependency-audit.yml`).
12
+
13
+ ## Tooling & commands
14
+
15
+ Scanners were installed into the project virtualenv only (`.venv`), never added
16
+ to runtime dependencies:
17
+
18
+ ```
19
+ .venv/bin/python -m pip install pip-audit bandit
20
+ ```
21
+
22
+ | Tool | Version | Command |
23
+ |-----------|---------|---------|
24
+ | pip-audit | 2.10.1 | `.venv/bin/python -m pip_audit -r requirements.txt --strict` |
25
+ | pip-audit | 2.10.1 | `.venv/bin/python -m pip_audit` (installed environment) |
26
+ | bandit | 1.9.4 | `.venv/bin/python -m bandit -r latticeai lattice_brain -ll` |
27
+ | npm audit | (npm 10)| `npm audit --audit-level=high` |
28
+
29
+ ## Dependency vulnerabilities (pip-audit / npm audit)
30
+
31
+ **Result: no known vulnerabilities.**
32
+
33
+ - `pip-audit -r requirements.txt --strict` → `No known vulnerabilities found`.
34
+ - `pip-audit` over the installed environment → `No known vulnerabilities found`.
35
+ - `npm audit --audit-level=high` → `found 0 vulnerabilities`.
36
+
37
+ No dependency version changes were required. Because there were no actual
38
+ vulnerable pins to fix, no dependency files were modified (per the honest-fix
39
+ rule: only fix a real, safe-to-fix issue).
40
+
41
+ ## Static code analysis (bandit)
42
+
43
+ Scanned **54,795 lines** across `latticeai/` and `lattice_brain/`. With the
44
+ `-ll` display filter (MEDIUM severity and above), bandit reported **80 findings**:
45
+ 1 HIGH and 79 MEDIUM. Breakdown by rule:
46
+
47
+ | Count | Severity | Rule | What it flags |
48
+ |------:|----------|------|---------------|
49
+ | 1 | HIGH | B324 hashlib | Weak MD5 hash "for security" |
50
+ | 58 | MEDIUM | B608 hardcoded_sql_expressions | SQL built via string formatting |
51
+ | 7 | MEDIUM | B310 blacklist (urlopen) | `urllib.request.urlopen` with unrestricted scheme |
52
+ | 5 | MEDIUM | B604 shell=True | A function called with `shell=True` |
53
+ | 3 | MEDIUM | B108 hardcoded_tmp_directory | Hardcoded `/tmp` path |
54
+ | 3 | MEDIUM | B104 hardcoded_bind_all_interfaces | Bind to `0.0.0.0` |
55
+ | 2 | MEDIUM | B306 blacklist (mktemp) | `tempfile.mktemp()` |
56
+ | 1 | MEDIUM | B615 huggingface_unsafe_download | `hf_hub_download` without a pinned revision |
57
+
58
+ ### Per-finding real-risk assessment
59
+
60
+ | Rule | Location(s) | Verdict | Rationale |
61
+ |------|-------------|---------|-----------|
62
+ | **B324** MD5 | `lattice_brain/quality.py:44` | **False positive** | MD5 derives a deterministic *pseudo-label* for embedding clusters (`emb_cluster_<hash>`); not used for authentication, integrity, or secrets. Safe cosmetic fix would be `hashlib.md5(..., usedforsecurity=False)`; source is out of this task's edit scope, so documented only. |
63
+ | **B604** shell=True | `latticeai/core/agent.py:539`, `latticeai/core/tool_registry.py:129/136/168/175` | **False positive** | These are `ToolPolicy(..., shell=True, ...)` dataclass *declarations* describing whether a tool is a shell tool — not `subprocess(..., shell=True)` calls. Bandit matches the keyword, not an actual shell invocation. |
64
+ | **B108** /tmp | `lattice_brain/graph/_kg_constants.py:186/215`, `latticeai/core/agent_eval.py:240` | **False positive / benign** | The `_kg_constants` hits are `/tmp` entries in an **exclusion allowlist** of directories to skip during ingestion (a defensive list). The `agent_eval` hit is a test/eval default `agent_root`. No untrusted file is written to a predictable temp path here. |
65
+ | **B104** 0.0.0.0 | `latticeai/cli/entrypoint.py:53/237/238` | **By design, low risk** | The bind switches to `0.0.0.0` only when the operator explicitly passes `--tunnel`; default remains `127.0.0.1`. Intentional and gated. |
66
+ | **B310** urlopen | `latticeai/services/model_engines.py:120/234`, `latticeai/services/model_runtime.py:242` | **Low real risk** | Calls target operator-configured local inference engines (LM Studio / Ollama). URLs are not attacker-controlled in normal use. Recommendation: assert `http(s)` scheme before `urlopen` to close the `file:`/custom-scheme door. |
67
+ | **B608** SQL f-strings | `lattice_brain/storage/postgres.py`, `.../migration.py`, `lattice_brain/graph/*.py`, `lattice_brain/conversations.py` | **Low real risk — review** | Interpolated fragments are overwhelmingly **schema/table identifiers** quoted through `lattice_brain.storage.postgres._quote_ident`, with row *values* passed as bound parameters. Not user-value injection. Standing recommendation: keep every interpolated identifier sourced from internal constants / allowlists, never from request input. |
68
+ | **B306** mktemp | `latticeai/integrations/telegram_bot.py:450/568` | **Real, low severity** | `tempfile.mktemp()` has a documented create-time race; prefer `tempfile.mkstemp()` / `NamedTemporaryFile`. Impact is limited (local temp files for outbound Telegram media), but this is a genuine hardening item for a future source-owning change. |
69
+ | **B615** HF download | `latticeai/services/model_runtime.py:601` | **Real, supply-chain relevant** | `hf_hub_download(...)` is called without `revision=`, so a mutated upstream model repo could serve a different artifact than expected. Recommendation: pin a commit/`revision` (or verify a hash) when fetching model weights. Ties directly into the P2 supply-chain theme. |
70
+
71
+ ## Actions taken vs deferred
72
+
73
+ - **Fixed:** nothing — no dependency vulnerability existed to fix safely, and
74
+ the code-level findings live in source files outside this task's edit scope.
75
+ - **Deferred (documented) hardening items**, for a future change that owns the
76
+ relevant source:
77
+ 1. Pin a `revision` in `model_runtime.py` `hf_hub_download` (B615).
78
+ 2. Replace `tempfile.mktemp()` in `integrations/telegram_bot.py` (B306).
79
+ 3. Validate URL scheme before `urlopen` in the model engine paths (B310).
80
+ 4. Optional cosmetic: `usedforsecurity=False` on the clustering MD5 (B324).
81
+
82
+ ## Limitations (honest)
83
+
84
+ - Static analysis only. No dynamic/DAST, no fuzzing, no secret-scanning here.
85
+ - bandit reasons syntactically; the false positives above were confirmed by
86
+ reading each site, not by suppression.
87
+ - pip-audit resolves against the OSV/PyPI advisory database as of the snapshot
88
+ date; new advisories appear continuously — see the scheduled
89
+ `dependency-audit` workflow for the ongoing signal.
90
+ - SBOMs (CycloneDX) for both ecosystems can be regenerated with
91
+ `.venv/bin/python scripts/generate_sbom.py`.
@@ -1,6 +1,6 @@
1
1
  # Lattice AI Trust Model
2
2
 
3
- Current release: **9.8.0 — Honest Knowledge Pipeline**.
3
+ Current release: **9.9.0 — Fail-Closed Trust**.
4
4
 
5
5
  Lattice AI is local-first, explicit about external communication, and honest
6
6
  when a capability is unavailable.